Skip to content

Latest commit

 

History

History
22 lines (20 loc) · 525 Bytes

02.recompose.md

File metadata and controls

22 lines (20 loc) · 525 Bytes

Using recompose

Use Recompose to memoize prop values

Reference:

BAD
export default (props, context) => {
  // ... do expensive compute on props ...
  return <SomeComponent {...props} />
}
GOOD
import { pure } from 'recompose';
// This won't be called when the props DONT change
export default pure((props, context) => {
  // ... do expensive compute on props ...
  return <SomeComponent someProp={props.someProp}/>
})