Closed
Description
Hello, I just got some error from require-default-props
rule:
`react/require-default-props`: propType "foo" is not required, but has no corresponding defaultProp declaration.
`react/require-default-props`: propType "baz" is not required, but has no corresponding defaultProp declaration.
Here is the code:
function Header({
foo = true,
bar,
baz = () => { /* noop */ },
}) {
return ...;
}
Header.propTypes = {
foo: PropTypes.bool,
bar: PropTypes.bool.isRequired,
baz: PropTypes.func,
};
I expected there is no error, but seems it causes the problem.
Any ideas?
Metadata
Metadata
Assignees
Labels
No labels