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
Using React 18 I started to notice these warning messages for default props. Warning: FormGroup: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
The console gets crowded with many of these messages, making it hard to check actual errors or any other important debug messages.
One important caveat we'll need to consider is how the Paragon docs site relies on propTypes and defaultProps to generate the props API sections for components (e.g., props API for Alert) as well.
One important caveat we'll need to consider is how the Paragon docs site relies on propTypes and defaultProps to generate the props API sections for components (e.g., props API for Alert) as well.
We use gatsby-transformer-react-docgen which in turn uses react-docgen which has supported TypeScript since 2019. So I'm hoping it should be close to working out of the box. It's something I'm interested in exploring once #3367 has merged. With that PR, the docs site uses React 18 and is now spitting out a lot of defaultProps warnings.
Feedback summary
Using React 18 I started to notice these warning messages for default props.
Warning: FormGroup: Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead.
The console gets crowded with many of these messages, making it hard to check actual errors or any other important debug messages.
Improvements
Migrating default props to normal JS parameters.
CC: @adamstankiewicz
The text was updated successfully, but these errors were encountered: