Projects
View on GitHub
alitajs/umi-plugin-keep-alive
alitajs/umi-plugin-keep-alive has 293 GitHub stars and 23 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-19 07:05 UTC. Last push 2022-11-01.
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
<KeepAlive> for umijs base on react-activation
Web & AppsREADME_EN.md
Originalumi-plugin-keep-alive
<KeepAlive> for umijs base on react-activation
English | 中文说明
Online Demo
https://codesandbox.io/s/umi-keep-alive-tabs-demo-knfxy
Usage
Install
npm install umi-plugin-keep-alive --save # or yarn add umi-plugin-keep-aliveexport
KeepAlivefrom umi and wrap any component you want to be keepedimport { useState } from 'react' import { KeepAlive } from 'umi' function Counter() { const [count, setCount] = useState(0) return ( <div> <p>count: {count}</p> <button onClick={() => setCount(count => count + 1)}>add</button> </div> ) } export default function() { const [show, setShow] = useState(true) return ( <div> <h1>Page index</h1> {show && ( <KeepAlive> <Counter /> </KeepAlive> )} <button onClick={() => setShow(show => !show)}>toggle</button> </div> ) }
Options
TODO
Documentation
All function of react-activation can be completely imported from umi
import {
KeepAlive,
useActivate,
useUnactivate,
withActivation,
withAliveScope,
useAliveController
} from 'umi'
Visit react-activation for full documentation
LICENSE
MIT