reactshouldupdate

1.0.1 • Public • Published

React componentShouldUpdate util

Usage


import checkDiff from 'reactshouldupdate';

    shouldComponentUpdate (nextProps, nextState) {
        return checkUpdate({
            props: {
                next: nextProps,
                current: this.props,
                checks: ['stateProps1', 'stateProps2']
            }
            state: {
                next: nextState,
                current: this.state,
                checks: ['stateKey1', 'stateKey2']
            }
        });
    }

Package Sidebar

Install

npm i reactshouldupdate

Weekly Downloads

4

Version

1.0.1

License

MIT

Last publish

Collaborators

  • exilz