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
// complains about 'baz' missing from prop-types validation
const Component = ({ foo, bar, baz }) => (
// ...JSX
);
// doesn't complain about 'baz' missing from prop-types validation
const Component = ({ foo, bar, baz } = {}) => (
// ...JSX
);
Component.propTypes = {
foo: PropTypes.string,
bar: PropTypes.string,
};
Since it's generally best-practice to provide defaults when destructuring, it would be nice if passing an empty object as a default param didn't break prop-types validation.
The text was updated successfully, but these errors were encountered:
Since it's generally best-practice to provide defaults when destructuring, it would be nice if passing an empty object as a default param didn't break prop-types validation.
The text was updated successfully, but these errors were encountered: