How to make pure component using in functional react component ?
const MyComponent = () => {
return (<h1>I am functional component.</h1>)
}
export default MyComponent;
How to make a pure component out of the above code ?
you can use React.memo
import React from 'react';
const MyComponent = () => {
return (<h1>I am functional component.</h1>)
}
export default React.memo(MyComponent);