Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property 'start' in type 'MainMenu' is not assignable to the same property in base type 'ReactUiBase'. #8

Open
sorskoot opened this issue Aug 26, 2024 · 2 comments

Comments

@sorskoot
Copy link
Contributor

Overriding the start function causes a TypeScript error saying that the return types are different.

Property 'start' in type 'MainMenu' is not assignable to the same property in base type 'ReactUiBase'.
  Type '() => void' is not assignable to type '() => Promise<void>'.
    Type 'void' is not assignable to type 'Promise<void>'.ts(2416)

image

@sorskoot
Copy link
Contributor Author

Ah... It has to be defined as
async start() {}

This is a bit confusing since a normal component doesn't need this.

@Squareys
Copy link
Collaborator

We could remove async from the parent and use Promise APIs instead. It seems like children can change to async, but once it's changed by a parent, it needs to be async all the way down 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants