Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

keepalive-for-react-router

finedaybreak1.2kMIT5.0.7TypeScript support: included

React Router integration for keepalive-for-react

keepalive, keep-alive, react keepalive, keepalive for react, keepalive-for-react, keepalive-for-react-router

readme

KeepAlive for React Router

Installation

npm install keepalive-for-react keepalive-for-react-router

v6+

npm install react-router-dom keepalive-for-react keepalive-for-react-router@1.x.x

v7+

npm install react-router keepalive-for-react keepalive-for-react-router@2.x.x

Usage

// v6+ keepalive-for-react-router@1.x.x
// v7+ keepalive-for-react-router@2.x.x
import KeepAliveRouteOutlet from "keepalive-for-react-router";

function Layout() {
    return (
        <div className="layout">
            <KeepAliveRouteOutlet />
        </div>
    );
}