react-view-cache:缓存React视图

时间:2021-05-11 22:36:55
【文件属性】:
文件名称:react-view-cache:缓存React视图
文件大小:405KB
文件格式:ZIP
更新时间:2021-05-11 22:36:55
JavaScript React视图缓存 缓存React视图。 介绍 使用react-view-cache,您可以在特殊的Cache组件中呈现组件。 当您在同一缓存中呈现另一个组件时,前一个组件不会立即卸载,而是通过设置为display: none隐藏,并保留所有状态。 将页面缓存在SPA中非常好。 通过在缓存挂钩中保存和还原滚动,您将获得一个优化的应用程序。 当您前后浏览时,上一页会立即显示旧滚动条,而无需重新加载。 此外,您还将花费更少的精力来管理页面之间的数据和状态。 基本用法 import createCache from "react-view-cache"; const Cache = createCache(); ... const view = ; // your component const viewId = ...; // unique cache id
【文件预览】:
react-view-cache-master
----src()
--------lib.js(891B)
--------index.js(6KB)
----.babelrc(47B)
----examples()
--------cache_page_with_scroll_restoration()
----test()
--------index.html(175B)
--------webpack.config.js(450B)
--------src()
--------.babelrc(47B)
--------dist()
--------package.json(450B)
----README.md(2KB)
----dist()
--------lib.js(2KB)
--------index.js(11KB)
----.gitignore(18B)
----CHANGELOG.md(135B)
----package.json(823B)

网友评论