react-memo-polyfill
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

react-memo

React.memo polyfill

Install

$ yarn add reactmemo

Usage

import memo from 'reactmemo'
 
function MyComponent(props) { }
 
memo(MyComponent)

Optionally pass your compare function

import memo from 'reactmemo'
 
function MyComponent(props) { }
function areEqual(prevProps, nextProps) {
  /*
  return true if passing nextProps to render would return
  the same result as passing prevProps to render,
  otherwise return false
  */
}
export default memo(MyComponent, areEqual);

Author

@zzarcon

/react-memo-polyfill/

    Package Sidebar

    Install

    npm i react-memo-polyfill

    Weekly Downloads

    0

    Version

    0.0.2

    License

    MIT

    Unpacked Size

    5.5 kB

    Total Files

    11

    Last publish

    Collaborators

    • zzarcon