Skip to content
master
Go to file
Code

Files

Permalink
Failed to load latest commit information.

README.md

react-default-memo

npm npm (tag) Release Coveralls semantic-release Dependabot

This is a proof of concept for "memoizing" React components by default and in a more comprehensive way than is possible either with React builtins like memo() or useMemo(), or with libraries like use-deep-compare-effect and react-fast-compare.

Demo (CodeSandbox).

Installation

npm i react-default-memo
yarn add react-default-memo

Usage

Add at the top of a file:

/** @jsx createValueElement */
import { createValueElement } from "react-default-memo";

This replaces the React builtin createElement() with a custom createValueElement() function using the @babel/plugin-transform-react-jsx plugin (included by default in tools like create-react-app).

License

MIT

You can’t perform that action at this time.