Commit 12ef6cd4 by Wee

docs(README): update readme to 1.3.0

parent daaac3c6
File deleted
**🚧 This project will be rewritten recently using TypeScript. Bug will be fixed and new features will be added.**
---
An enhanced version of **react-router-v4 Route** Component that keeps route component alive on unmatched path and restore it completely on match path.
## Document
......@@ -25,13 +21,13 @@ You also can scan the QR code of the demo above to experience it on mobile devic
## Install
```bash
npm install react-live-route --save-dev
npm install react-live-route
```
or
```bash
yarn add react-live-route --dev
yarn add react-live-route
```
## About
......@@ -89,6 +85,19 @@ import LiveRoute from 'react-live-route'
<LiveRoute path="/list" alwaysLive={true} component={Modal}/>
```
### onHide: (routeState: {location, livePath, alwaysLive}) => any
This hook will be triggered when LiveRoute will hide in `componentWillReceiveProps` stage (so it happens before re-render).
### onReappear: (routeState: {location, livePath, alwaysLive}) => any
This hook will be triggered when LiveRoute will reappear from hide in `componentWillReceiveProps` stage (so it happens before re-render).
## TODO
- [ ] add test case
- [ ] add forceUnmount prop
## Licence
MIT
......@@ -83,6 +83,14 @@ import LiveRoute from 'react-live-route'
<LiveRoute path="/list" alwaysLive={true} component={Modal}/>
```
### onHide: (routeState: {location, livePath, alwaysLive}) => any
这个钩子函数会在 LiveRoute 将要隐藏时在 `componentWillReceiveProps` 周期触发。
### onReappear: (routeState: {location, livePath, alwaysLive}) => any
这个钩子函数会在 LiveRoute 将要从隐藏状态恢复显示时在 `componentWillReceiveProps` 周期触发。
### forceUnmount (WIP) 🚧
可以传入一个函数,当这个函数返回值为真时,可以强制路由对应的组件卸载,对应的函数签名为
......
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "react-live-route",
"version": "1.2.4",
"version": "1.3.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment