-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Prop types don't match runtime types #2338
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
Yet another reproduction Version Reproduction link What is expected? What is actually happening? |
I'm also having a lot of problems with props in TypeScript. Version Reproduction link |
@JensD98 please open a separate issue since it's a different problem. |
Version
3.0.0
Reproduction link
https://codepen.io/kaelwd/pen/oNLgNGe?editors=1010
Steps to reproduce
Use boolean props in a typescript component
What is expected?
Boolean props should have type
boolean
, as their default default value isfalse
What is actually happening?
All non-required props without a default value are
T | undefined
component.test-d.ts
usesrequired: true
to strip the undefined, but this is incorrect as boolean props aren't necessarily required. There are no checks for non-required boolean props.Changing
RequiredKeys
tofixes it
but seems wrong as they aren't actually required.default is in there already so whatever.The text was updated successfully, but these errors were encountered: