See more
I can even be more specific and target only the props that I know may change, using recompose’s shouldUpdate() instead of pure():
shouldUpdate()
pure()
The only difference between this code and the initial implementation is the last line: I export pure(DatagridBody) instead of DatagridBody. pure is like PureComponent, but without the extra class boilerplate.
pure(DatagridBody)
DatagridBody
pure
PureComponent
class DatagridBody extends Component { shouldComponentUpdate(nextProps) { return (nextProps.ids !== this.props.ids || nextProps.data !== this.props.data); }