0.1.0 • Published 6 years ago
ytho v0.1.0
ytho
Your React components are updating uselessly. ytho
helps you figure out why that's happening.
ytho
carries the torch from why-did-you-update
, but it only works for React 16.3+.
It works by wrapping all your components in a Higher-Order Component that deeply diffs your components' props
and state
. It requires React 16.3+ because I want to experiment with the newer React APIs. You can imagine all the diffing is CPU-intensive, so using this other than for development purposes is a Very Bad Idea.
Usage
Installation
Install ytho
from NPM:
npm install --save-dev ytho
or using Yarn:
yarn add --dev ytho
Then, in your code:
import ytho from 'ytho';
import React from 'react';
// Only in development mode!
if (process.env.NODE_ENV === 'production') {
ytho(React);
}
0.1.0
6 years ago