1.0.2 • Published 2 years ago

ex-component-update v1.0.2

Weekly downloads
49
License
-
Repository
github
Last release
2 years ago

ex-component-update

sh: npm install ex-component-update

A convenient alternative to shouldComponentUpdate. Freezes only the component itself, without affecting children. It is enough to return a list of values that affect the render.

import modelScreen from 'src/models/modelScreen.js'

class MyCard extends React.Component {
    constructor() {
        exComponentUpdate(this, false|true|options);
        ..
    };

    exComponentUpdate(nextProps, nextState) {
        var data = nextProps.data || false;
        return [
            modelScreen.width <= 500,
            modelScreen.width <= 980,
            data.name,
            data.email,
            data.phone,
            ..
        ];
    };

    render() {
        return ...
    };
};
1.0.2

2 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.4.0

5 years ago

0.3.0

6 years ago

0.2.0

8 years ago

0.1.1

8 years ago