Closed Leecason closed 1 year ago
<ReactLightchartsCore>
是你自己的组件吗?
有没有完整的例子可以提供
我创建了一个 echarts-for-react
官方的 demo
https://codesandbox.io/s/lucid-wilson-6hh9pn
没有看见你的报错
<ReactLightchartsCore>
是你自己的组件吗? 有没有完整的例子可以提供
应该是 import ReactECharts from "echarts-for-react";
这个组件
我创建了一个
echarts-for-react
官方的 demo https://codesandbox.io/s/lucid-wilson-6hh9pn 没有看见你的报错
用法有点不一样,我这边 <KeepAlive>
是当组件使用的,另外 <KeepAlive.Provider>
包裹的必须是最外层的 <App>
吗,我包裹的是一个子组件。
<KeepAlive.Provider>
不一定在最外层。
但是一般能拿到 container element 的都在入口处。
同时如果 <KeepAlive.Provider>
也卸载了,那所有的cache 也都没有了。
<KeepAlive.Provider>
不一定在最外层。 但是一般能拿到 container element 的都在入口处。 同时如果<KeepAlive.Provider>
也卸载了,那所有的cache 也都没有了。
请问一下有试过把 KeepAlive 当组件用的例子吗
https://codesandbox.io/s/keep-alive-react-router-example-hfbbi7
其中 Page B (Keep-Alive Items) 就是一个页面中有多个 <KeepAlive>
介于你只提供了一张报错截图,我在 echarts
和 echarts-for-react
的源码中也未发现图中的函数
如果方便的话,还请创建一个demo,我才能更明确的帮到你 @Leecason
"react-fiber-keep-alive": "^0.6.3", "react": "18.2.0", "react-dom": "18.2.0", "echarts": "5.0.2", "echarts-for-react": "3.0.1",