-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
React 18 warning defaultProps will be removed from function components #2919
Comments
I could help with this if you like. I verified that our current version of react-docgen works when the default props are defined in the function parameter like this:
https://react-docgen.dev/docs/reference/handlers/default-props-handler I started by updating I'm not sure how to test this though. I don't see any warnings when I run a dash app with React 18 |
I verified that our current version of react-docgen works when the default props are defined in the function parameter like this: Great, all the core components are still in js, will need to validate if it works with the typescript components or if we need to add more code.
The deprecation starts with version 18.3.0: https://github.com/facebook/react/blob/main/CHANGELOG.md#1830-april-25-2024 That version is not listed here: Lines 5 to 6 in 1753459
So just need to add it. |
Running an app with React 18 emit a warning that defaultProps for functions components are deprecated.
Warning message:
Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
We use the defaultProps for our own components generator in either the generated react-docgen metadata or the typescript transpiler. We do not support newer version of react-docgen (5.4.3 is our last supported version) that may have a fix for this in their code. The typescript transpiler needs to be adapted.
Affected core components:
The text was updated successfully, but these errors were encountered: