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
When building a form using your component library I kept running into a console waring stating:
"Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead."
Upon further investigation I found that this was coming from the DatePicker component. At the end of DatePicker.tsx you are using
DatePicker.defaultProps = {
minDate: DEFAULT_MIN_DATE,
}
to set a minimum allowable date for the datepicker component, this is trggering the warning.
defaultProps is also used in the Tooltip component. To Reproduce
Steps to reproduce the behavior:
Create a page and use the datepicker and tooltip components
Render that page
Open dev tools in the browser and view the console
See error: "Support for defaultProps will be removed from function components in a future major release. Use JavaScript default parameters instead."
Expected behavior
No warning should appear in the console to prep your library for deprecating feature support.
Screenshots
Additional context
Device and Browser Information (please complete the following information if describing a UI bug):
Google Chrome running a Vite React application on Windows.
The text was updated successfully, but these errors were encountered:
ReactUSWDS Version & USWDS Version:
Describe the bug
When building a form using your component library I kept running into a console waring stating:
Upon further investigation I found that this was coming from the DatePicker component. At the end of DatePicker.tsx you are using
DatePicker.defaultProps = {
minDate: DEFAULT_MIN_DATE,
}
to set a minimum allowable date for the datepicker component, this is trggering the warning.
defaultProps is also used in the Tooltip component.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No warning should appear in the console to prep your library for deprecating feature support.
Screenshots
Additional context
Device and Browser Information (please complete the following information if describing a UI bug):
Google Chrome running a Vite React application on Windows.
The text was updated successfully, but these errors were encountered: