Closed
Description
Given the following code
import React from 'react';
const TestStateless = React.memo(props => (
<div>{props.children}</div>
));
class Test extends React.Component {
render() {
return <TestStateless><p>I am wrapped in TestStateless</p></TestStateless>
}
}
export default Test;
and rule config,
"react/no-multi-comp": ["error", { "ignoreStateless": true }]
I would expect no error, but I get errors as though ignoreStateless were its default of false.
When I define the stateless component outside React.memo then wrap it,
import React from 'react';
const stateless = props => <div>{props.children}</div>
const TestStateless = React.memo(stateless);
class Test extends React.Component {
render() {
return <TestStateless><p>I am wrapped in TestStateless</p></TestStateless>
}
}
export default Test;
there are no errors.