# CJY0208/react-router-cache-route

Route with cache for react-router V5 like <keep-alive /> in Vue

Repository: https://github.com/CJY0208/react-router-cache-route
Canonical: https://ross.abutalabs.com/products/react-router-cache-route
Homepage: https://www.npmjs.com/package/react-router-cache-route
Language: JavaScript
License: MIT
License Family: permissive
Topics: react-route, react, cache, router
Last push: 2024-11-21T02:06:34+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 2990, "days_push": 651, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1177, forks 113 (observed 2026-08-28T04:03:52.736837+00:00)

## What it is
A React library providing CacheRoute and CacheSwitch components that cache route components instead of unmounting them, similar to Vue's <keep-alive>. It works only with React Router v4/v5 and React v15+.

## Use cases
- preserve form state when navigating away and back
- keep list scroll position when opening a detail page
- avoid refetching data when returning to a cached route
- keep component interaction state across route changes in React Router v5
- implement keep-alive behavior like Vue in a React app

## When to choose
- you use React Router v4 or v5 and need cached routes
- you lose form input or scroll state when switching routes
- you want Vue-style keep-alive semantics in React

## When to avoid
- you use React Router v6 or later (unsupported)
- you only need KeepAlive without routing (use react-activation instead)
- you are starting a new project on modern React Router

## Facets
- artifact type: library
- maturity: maintenance
- function: routing, state-management, caching
- domain: web-development, frontend
- platform: browser
- tags: react-router, keep-alive, react, route-caching, v5-only, nodejs

## Member repositories
- CJY0208/react-router-cache-route (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:52.736837+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-30T06:26:10.336640+00:00, confidence not recorded.
  - readme: https://github.com/CJY0208/react-router-cache-route (fetched 2026-08-28T04:03:52.736837+00:00, sha 9331b43dcf10)
  - registry_npm: https://registry.npmjs.org/react-router-cache-route (fetched 2026-08-29T12:32:40.923509+00:00, sha 1a712ac16813)
- Data as of 2026-08-30T08:39:29.467469+00:00.
