# why-did-you-update-immutable

> Patch React to discover unnecessary re-renders

Latest version **0.0.13** (published 2018-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install why-did-you-update-immutable
pnpm add why-did-you-update-immutable
yarn add why-did-you-update-immutable
bun add why-did-you-update-immutable
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2018-10-23 |
| First published | 2018-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4924 |
| Author | Gabe Scholz |
| Maintainers | petrbrzek |
| Keywords | react-component |

## Links

- npm: https://www.npmjs.com/package/why-did-you-update-immutable
- Repository: https://github.com/garbles/why-did-you-update
- npm.io page: https://npm.io/package/why-did-you-update-immutable

## Dependencies (3)

- [lodash](https://npm.io/package/lodash.md) ^4.15.0
- [immutable](https://npm.io/package/immutable.md) ^3.7.6
- [lodash-deep](https://npm.io/package/lodash-deep.md) latest

## Recent versions

- 0.0.13 (latest) — 2018-10-23
- 0.0.12 — 2018-10-23
- 0.0.11 — 2018-10-23
- 0.0.9 — 2018-03-29
- 0.0.8 — 2018-03-29

## README

# Why did you update, bruh?

[![Travis][build-badge]][build]
[![npm version](https://badge.fury.io/js/why-did-you-update.svg)](https://badge.fury.io/js/why-did-you-update)

### Wat?

![](http://i.imgur.com/Ui8YUBe.png)

A function that monkey patches React and notifies you in the console when **potentially** unnecessary re-renders occur. Super helpful for easy perf gainzzzzz.

### How to

```js
import React from 'react'

if (process.env.NODE_ENV !== 'production') {
  const {whyDidYouUpdate} = require('why-did-you-update')
  whyDidYouUpdate(React)
}
```

You can include or exclude components by their displayName with the include and exclude options

```js
whyDidYouUpdate(React, { include: /^pure/, exclude: /^Connect/ })
```

### Credit

I originally read about how Benchling created a mixin to do this on a per component basis ([A deep dive into React perf debugging](http://benchling.engineering/deep-dive-react-perf-debugging/)).
That is really awesome but also tedious AF, so why not just monkey patch React.

[build-badge]: https://img.shields.io/travis/garbles/why-did-you-update/master.svg?style=flat-square
[build]: https://travis-ci.org/garbles/why-did-you-update

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