</>PackageGraphPackageGraph

react-fast-compare

npmv3.2.2TypeScript

Fastest deep equal comparison for React. Great for React.memo & shouldComponentUpdate. Also really fast general-purpose deep comparison.

Not recommended for new projects

No — react-fast-compare should not be adopted for new projects. Last published 1210 days ago.

  • ?Adoption: grade ?, Not reported by this registry.

    No download data reported for this package yet.

  • FMaintenance: grade F, Failing.

    Last published 1210 days ago.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 16 KB installed.

  • ASupply chain: grade A, Excellent.

    No install scripts, 21 maintainers, and a contained dependency surface.

  • ALicense: grade A, Excellent.

    MIT — permissive, with no copyleft found in the dependency tree.

Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.

Install cost

What you actually take on by adding react-fast-compare to a project.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

16 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

Longest resolved dependency chain below this package.

Compatibility

Node.js
No constraint declared
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the react-fast-compare README.

const isEqual = require("react-fast-compare");

// general usage
console.log(isEqual({ foo: "bar" }, { foo: "bar" })); // true

// React.memo
// only re-render ExpensiveComponent when the props have deeply changed
const DeepMemoComponent = React.memo(ExpensiveComponent, isEqual);

// React.Component shouldComponentUpdate
// only re-render AnotherExpensiveComponent when the props have deeply changed
class AnotherExpensiveComponent extends React.Component {
  shouldComponentUpdate(nextProps) {
    return !isEqual(this.props, nextProps);
Example truncated — see the full README.

react-fast-compare vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
react-fast-comparethis page01MIT3 years ago
fast-deep-equal06MIT1 day ago
deep-equal06MIT1 day ago
leven02MIT1 day ago
deep-is01MIT1 day ago
shallowequal01MIT1 day ago

Dependencies

Declared by react-fast-compare v3.2.2. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (46)

@babel/core ^7.21.0@babel/preset-env ^7.20.2@changesets/cli ^2.26.1@svitejs/changesets-changelog-github-compact ^0.1.1@testing-library/dom ^9.0.1@testing-library/preact ^3.2.3@types/node ^18.15.0@types/react ^16.9.35@types/react-dom ^16.9.8@types/react-redux ^7.1.25@typescript-eslint/parser ^5.54.1assert ^2.0.0babel-loader ^9.1.2benchmark ^2.1.4builder ^5.0.0codecov ^3.8.3core-js ^3.29.0eslint ^8.35.0eslint-plugin-react ^7.32.2fast-deep-equal 3.1.3fast-deep-equal-git github:epoberezkin/fast-deep-equal#v3.1.3jsdom ^21.1.0jsdom-global ^3.0.2karma ^6.4.1karma-chrome-launcher ^3.1.1karma-firefox-launcher ^2.1.2karma-mocha ^2.0.1karma-mocha-reporter ^2.2.5karma-safari-launcher ^1.0.0karma-webpack ^5.0.0lodash ^4.17.10mocha ^10.2.0nano-equal ^2.0.2nyc ^15.1.0preact ^10.13.1process ^0.11.10react ^18.2.0react-dom ^18.2.0react-redux ^8.0.5react-test-renderer ^18.2.0redux ^4.2.1shallow-equal-fuzzy 0.0.2sinon ^15.0.1terser ^5.16.6typescript ^4.9.5webpack ^5.76.0

Used by

Popular packages that depend on react-fast-compare.

Relationship graph

Dependencies (left) and dependents (right) of react-fast-compare.

expo-routerreact-fast-compare
react-fast-compare dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 53 days apart.

Recent versions of react-fast-compare
VersionPublishedSizeLicense
3.2.2latest3 years ago16 KBMIT
3.2.13 years ago16 KBMIT
3.2.06 years ago18 KBMIT
3.1.16 years ago17 KBMIT
3.1.06 years ago17 KBMIT
3.0.26 years ago16 KBMIT
3.0.16 years ago16 KBMIT
3.0.06 years ago16 KBMIT
3.0.0-beta.16 years ago15 KBMIT
2.0.47 years ago11 KBMIT
2.0.37 years ago11 KBMIT
2.0.28 years ago11 KBMIT
2.0.18 years ago11 KBMIT
2.0.08 years ago11 KBMIT
1.0.08 years ago8.2 KBMIT

Overview

react-fast-compare is an npm package that fastest deep equal comparison for React. Great for React.memo & shouldComponentUpdate. Also really fast general-purpose deep comparison. It has 1 known dependents in the graph. The latest version is 3.2.2, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need fastest deep equal comparison for React. Great for React.memo & shouldComponentUpdate. Also really fast general-purpose deep comparison and value a focused solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.

Pros

  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • Large dependency tree (46 direct dependencies) increases install size and audit surface.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Frequently asked questions

Should I use react-fast-compare?

No — react-fast-compare should not be adopted for new projects. Last published 1210 days ago.

How do I install react-fast-compare?

Run `npm install react-fast-compare` to add react-fast-compare to your npm project.

What license is react-fast-compare released under?

react-fast-compare is distributed under the MIT license.

How popular is react-fast-compare?

npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on react-fast-compare.

Is react-fast-compare still maintained?

The most recent release of react-fast-compare (v3.2.2) was published 3 years ago.

Does react-fast-compare run install scripts?

No. react-fast-compare does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.