Closed as not planned
Description
Sometimes inexperienced developers define functions that return jsx that would better work as components.
example:
const App = () => {
function renderIcon() {
return <i />;
}
return (
<div>{renderIcon()}</div>
);
}
I’d like a rule to forbid this behavior and instead suggest to convert it to a proper competent called with jsx.
this allows React to optimize its re-renders.