# cache-react-component

> A React Component Cache Wrapper

Latest version **0.0.2** (published 2016-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install cache-react-component
pnpm add cache-react-component
yarn add cache-react-component
bun add cache-react-component
```

## 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.2 |
| Published | 2016-09-21 |
| First published | 2016-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | xialvjun |
| Maintainers | xialvjun |
| Keywords | react, cache, component, router |

## Links

- npm: https://www.npmjs.com/package/cache-react-component
- Repository: https://github.com/xialvjun/cache-react-component
- Issues: https://github.com/xialvjun/cache-react-component/issues
- npm.io page: https://npm.io/package/cache-react-component

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-09-21
- 0.0.1 — 2016-08-09

## README

Wrap a component class and get the `CachedComponent`.

This `CachedComponent` will calculate a `key` from `props` and use the `key` to decide whether to construct a new instance and cache the old or to recover the old component from cache and update `props`.

We can use it with `react-router` easily to save up the time of constructing the **RouteComponent** you already constructed, and achieve an much more fluent routing experience like the native apps.

And besides, this tool also offers some switching component hooks. You can use these hooks to make something like **animation** and so on.

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