react-router-cache-route

JSON →
library 1.13.0 ·javascript
verified Jun 7, 2026

A React component that provides Vue-like keep-alive caching for react-router v4+ routes. Version 1.13.0 is the latest stable release; the package is maintained sporadically with low release cadence. It uses a `CacheRoute` wrapper that hides instead of unmounts the component when the route becomes unmatched, preserving component state and DOM. It also provides a `CacheSwitch` to replace `Switch` for proper caching behavior. Alternatives include `react-activation` for a standalone `<KeepAlive>` component.