You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if the defaultProps property is required internally, it might be generated on fly based on the propTypes Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
N/A
Cheers
The text was updated successfully, but these errors were encountered:
These are two different systems, and it doesn't make sense to me to conflate them. People may not even use PropTypes (e.g. if they use TypeScript or Flow instead) but still use defaultProps.
I understanding it's tempting to reduce typing, but these are two separate concerns.
Do you want to request a feature or report a bug?
feature
What is the current behavior?
Defining an optional type in
propTypes
for components make us define thedefaultProps
as well.What is the expected behavior?
Set default value during propTypes definition.
if the
defaultProps
property is required internally, it might be generated on fly based on thepropTypes
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
N/A
Cheers
The text was updated successfully, but these errors were encountered: