# ex-component-update

> shouldComponentUpdate tools

Latest version **1.0.2** (published 2022-04-08) · 0 weekly downloads

## Install

```sh
npm install ex-component-update
pnpm add ex-component-update
yarn add ex-component-update
bun add ex-component-update
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-04-08 |
| First published | 2016-03-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Vopilovskiy Konstantin |
| Maintainers | vflash |
| Keywords | shouldComponentUpdate, reactjs |

## Links

- npm: https://www.npmjs.com/package/ex-component-update
- Repository: https://github.com/vflash/ex-component-update
- Issues: https://github.com/vflash/ex-component-update/issues
- npm.io page: https://npm.io/package/ex-component-update

## Dependencies (1)

- [react-all-elements](https://npm.io/package/react-all-elements.md) ^1.0.0

## Recent versions

- 1.0.2 (latest) — 2022-04-08
- 1.0.1 — 2019-02-26
- 1.0.0 — 2019-02-26
- 0.4.0 — 2019-01-10
- 0.3.0 — 2018-06-01
- 0.2.0 — 2016-09-16
- 0.1.1 — 2016-03-05

## README

# 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.


```js
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 ...
    };
};

```

---
_Source: https://npm.io/package/ex-component-update · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
