Keep react component view / store when switched view.
npm install @rcp/c.keepalive

Keep react component view / store when switched view rather than unmount it.
``bash`
npm install @rcp/c.keepaliveor use yarn
yarn add @rcp/c.keepalive
`jsx
import KeepAlive, { bindKeepAliveLifeCycle } from '@rcp/c.keepalive'
import '@rcp/c.keepalive/style.less'
@bindKeepAliveLifeCycle
class Content extends React.Component {
// 新增的生命周期
componentWillActive({newValue, oldValue}) {}
componentDidActive({newValue, oldValue}) {}
componentWillUnactive({newValue, oldValue}) {}
componentDidUnactive({newValue, oldValue}) {}
}
// LifeCycle
// componentWillActive => {newValue: '/home'}
// componentDidActive => {newValue: '/home'}
// Components
// <>
//
// >
// Update
// LifeCycle
// componentWillUnactive => {newValue: '/detail', oldValue: '/home'} (Home)
// componentWillActive => {newValue: '/detail', oldValue: '/home'} (Detail)
// componentDidUnactive => {newValue: '/detail', oldValue: '/home'} (Home)
// componentDidActive => {newValue: '/detail', oldValue: '/home'} (Detail)
// Components
// <>
//
//
// >
`
- Type: string
- Type: boolean`
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
MIT