react-memo
React.memo polyfill
- What: https://reactjs.org/docs/react-api.html#reactmemo
- Why: https://medium.com/@trekinbami/using-react-memo-and-memoization-1970eb1ed128
- When: React.memo was introduced in React@16.6.0. You can use this polyfill until you upgrade your components
Install
$ yarn add reactmemo
Usage
{ }
Optionally pass your compare function
{ } { /* return true if passing nextProps to render would return the same result as passing prevProps to render, otherwise return false */}MyComponent areEqual;