# CJY0208/react-activation

Hack <KeepAlive /> for React

Repository: https://github.com/CJY0208/react-activation
Canonical: https://ross.abutalabs.com/products/react-activation
Homepage: https://www.npmjs.com/package/react-activation
Language: JavaScript
License: MIT
License Family: permissive
Topics: keepalive, react, cache-control, keep-alive, cache, offscreen
Last push: 2025-05-21T02:46:02+00:00

## Health v2 (maintenance only)
Score: 33/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 22, release rhythm 8, longevity 100
- inputs: {"age_days": 2555, "days_push": 469, "days_rel": 650, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2029, forks 151 (observed 2026-08-28T04:06:07.150214+00:00)

## What it is
A React library that implements Vue's <keep-alive /> component caching behavior, preserving component state when they are unmounted and remounted. It works via a hack implementation compatible with React 16-18, Preact, and SSR.

## Use cases
- preserve component state when switching tabs in react-router
- cache form input values when navigating away and back
- implement closable tabs that keep their state like in Vue
- keep list scroll position and filters when returning to a page
- cache multi-step wizard state across route changes

## When to choose
- you need Vue-style keep-alive state preservation in a React app
- you're building tabbed interfaces where each tab must retain its state
- you're on React 16/17/18 and need component caching without rewriting to hooks

## When to avoid
- you use React.StrictMode or ReactDOMClient.createRoot without disabling autoFreeze
- you can wait for or use React 18's official <Offscreen /> support
- your project doesn't use Babel and you can't manage cacheKey manually

## Facets
- artifact type: library
- maturity: active
- function: state-management, ui-components, middleware
- domain: frontend, web-development
- platform: -
- tags: keep-alive, react, component-caching, tabs, react-router, ssr-compatible, web-server, nodejs

## Member repositories
- CJY0208/react-activation (main) score 33

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:07.150214+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:59:36.499842+00:00, confidence not recorded.
  - readme: https://github.com/CJY0208/react-activation (fetched 2026-08-28T04:06:07.150214+00:00, sha aace787f3b14)
  - registry_npm: https://registry.npmjs.org/react-activation (fetched 2026-08-29T10:39:37.941417+00:00, sha db81406805e5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
