-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Type error with React.Component<void, void> #15419
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
Comments
Why don't you use |
as @aluanhaddad noted, |
Duplicate of #15409 |
Ok thanks! |
Just ran into this same issue after updating. Thanks! Side note: I thought it was standard to use "void" as the state/props type when they don't exist. My guess is a lot of people will have broken builds when they upgrade. |
TypeScript Version: 2.3.1
Code
Expected behavior:
It doesn't give a type error.
Actual behavior:
At the location the component is instantiated:
This could be a typings error perhaps, but it seems wrong to have to create a functional component to not have any props, or have to make the props type
undefined
?The text was updated successfully, but these errors were encountered: