Skip to content

imsitnikov/react-memo

 
 

Repository files navigation

react-memo

React.memo polyfill

Install

$ yarn add react-memo-polyfill

Usage

import memo from 'react-memo-polyfill'

function MyComponent(props) { }

memo(MyComponent)

Optionally pass your compare function

import memo from 'react-memo-polyfill'

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

About

React.memo polyfill

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 92.9%
  • HTML 7.1%