This seems to happen when
- I take a component as a prop
- I use that component as a JSX constructor in a hook
Minimal repro:
export const Foo = ({ Component }) => {
React.useEffect(() => {
console.log(<Component />);
}, []);
};
"eslint-plugin-react-hooks": "^4.1.1",
Interestingly, this does NOT cause the error:
export const Foo = ({ component }) => {
React.useEffect(() => {
const Component = component;
console.log(<Component />);
}, []);
};