We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the problem
React version 18 doesn't use defaultProps anymore. It gave this warning every time I ran the app, and the logs are very long, it kind of annoying.
defaultProps
The root of the problem here: https://github.com/elastic/eui/blob/main/src/components/button/button.tsx#L135 Other components might also be affected.
Before
EuiButton.defaultProps = { size: 'm', color: 'primary', };
After
export const EuiButton = ({ size = 'm', color = 'primary' }) => { // Your component logic here return ( <EuiButton size={size} color={color}> Button </EuiButton> ); };
You can set default values directly within the component function.
The text was updated successfully, but these errors were encountered:
Hey team 👋 . I marked this as high priority and sized it as small. Let's see if we can get this cleaned up quickly.
Sorry, something went wrong.
color="ghost"
cee-chen
Successfully merging a pull request may close this issue.
Describe the problem
React version 18 doesn't use
defaultProps
anymore. It gave this warning every time I ran the app, and the logs are very long, it kind of annoying.The root of the problem here: https://github.com/elastic/eui/blob/main/src/components/button/button.tsx#L135
Other components might also be affected.
Proposed solution
Before
After
You can set default values directly within the component function.
The text was updated successfully, but these errors were encountered: