# preact-shallow-compare

> shallowCompare for preact. react-shallow-compare detached from React.

Latest version **1.2.0** (published 2016-10-17) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install preact-shallow-compare
pnpm add preact-shallow-compare
yarn add preact-shallow-compare
bun add preact-shallow-compare
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-10-17 |
| First published | 2016-04-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Kye Hohenberger |
| Maintainers | tkh44 |
| Keywords | preact, preact-compat, shallow, shallowCompare, preact shallowCompare |

## Links

- npm: https://www.npmjs.com/package/preact-shallow-compare
- Repository: https://github.com/tkh44/preact-shallow-compare
- Issues: https://github.com/tkh44/preact-shallow-compare/issues
- npm.io page: https://npm.io/package/preact-shallow-compare

## Recent versions

- 1.2.0 (latest) — 2016-10-17
- 1.1.0 — 2016-10-17
- 1.0.1 — 2016-04-04
- 1.0.0 — 2016-04-04

## README

# preact-shallow-compare

[![npm package][npm-badge]][npm]

shallowCompare for preact. react-shallow-compare detached from React.

##Example
```javascript
import { h, Component } from 'preact';
import shallowCompare from 'preact-shallow-compare';


class Foo extends Component {

    constructor(props) {

        super(props);

        this.state = { color: 'blue' };
    }

    shouldComponentUpdate(nextProps, nextState) {

        return shallowCompare(this, nextProps, nextState);
    }

    render() {

        return h('div', null, this.state.color);
    }

}
```

[npm-badge]: https://img.shields.io/npm/v/npm-package.svg?style=flat-square
[npm]: https://www.npmjs.org/package/npm-package

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