Comments (3)
请问可以给一个完成的可以跑起来的示例吗?你这个 KeepAliveRoute 缓存的是真实的 DOM,按照 README 里面的 gif,切换回去数字还是 8,如果在点击 add,这个数字会是 1 还是 9?
您好,首先回答问题,肯定是9,功能主要是让整个fiber树存活,包括状态 ,稍后我会写几个应用场景的demo,上传到项目的example文件夹下面(目前还没有),非常感谢您的宝贵建议。
from react-keepalive-router.
请问可以给一个完成的可以跑起来的示例吗?你这个 KeepAliveRoute 缓存的是真实的 DOM,按照 README 里面的 gif,切换回去数字还是 8,如果在点击 add,这个数字会是 1 还是 9?
react-keepalive-router
发布1.1.2版本
更改如下:
1 增加页面生命周期 激活状态actived
钩子 缓存状态钩子unActived
。
2 支持缓存scroll
滚动条位置。
3 keepaliveRoute
,UNSAFE_componentWillReceiveProps
代替 componentWillReceiveProps
。
4 提供了完整的demo
项目。example
文件夹下。
详情参考: https://github.com/GoodLuckAlien/react-keepalive-router
from react-keepalive-router.
demo跑不起来
from react-keepalive-router.
Related Issues (17)
- 安装使用出现的几个问题 HOT 20
- 这个真好,希望能一起贡献
- 动态路由变化动态参数后,没有重新请求 HOT 1
- 如何实现后退缓存,前进或者平级路由清除缓存 HOT 1
- 路由的exact属性无效
- Cannot read properties of undefined (reading 'state') HOT 1
- 用react 18的import ReactDOM from 'react-dom/client' ReactDOM.createRoot 会报错,请问有解决方案?
- scroll设置不生效
- addKeeperListener 触发多次
- 问题太多了啊,没法用。。
- Attempted import error: '__RouterContext' is not exported from 'react-router-dom'. HOT 2
- 建议 HOT 5
- useCacheDispatch这个有类组件的方法么? HOT 1
- useParams无效
- 你好,hooks里面怎么使用周期 HOT 1
- 函数组件中页面表现与react的实际状态不一致 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-keepalive-router.