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
7.12.0 can't add properties to propType #2122
Comments
That’s not actually necessary - try this: let menuItemPropTypes;
menuItemPropTypes = {
id: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
path: PropTypes.string,
menuItems(...args) {
return PropTypes.arrayOf(PropTypes.shape(menuItemPropTypes))(...args);
},
}; Mutation after the fact is almost never required. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Are you sure this is a regression with v7.12.0 ? I tried with v7.11.1 and I still have the |
After further investigation it looks like I can reproduce the issue with this minimal code
With 7.11.0 the spread operator ( After updating to 7.12.0 (and restarting VS Code) I do have the errors with the spread operator. I found this stackoverflow question Spread operator on a component disables the react/prop-types rule on eslint-config-airbnb with a similar issue. It seems to be related to #1939 Thanks for the help |
Since v7.12.0 it is not possible to alter propTypes anymore
Let's consider this code
With 7.11.1 this code validates without error but since 7.12.0 we have a
I need to alter the propTypes object to support hierarchy. ie :
The text was updated successfully, but these errors were encountered: