Reputation: 574
Using react 16.6 I am trying to use memo with stateless component but I get an error.
Error
react-dom.development.js:57 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.
Code:
const MyComponent = () => (
<React.Fragment>
TEST
</React.Fragment>
);
export default React.memo(MyComponent);
Upvotes: 1
Views: 1223