标签: react-cache

react-cache / suspense中的invalidate_createResource无效

如何使由创建的资源无效react-cache

我可以从API获取数据:

const FooResource = createResource(id => fetch(`/foo/${id}`)); // return a promise, or async/await

// inside render...
const fooResponse = FooResource.read(id); // suspends if not in cache; renders if in cache
return <div> {fooResponse} </div>;
Run Code Online (Sandbox Code Playgroud)

但是,当我在后端更新数据时,我无法重新获取前端的数据。

这是我唯一能找到的官方文档:https : //github.com/sw-yx/fresh-concurrent-react/blob/master/apis/react-cache.md

我可以使用一些未公开的API吗?

invalidation reactjs react-cache

4
推荐指数
1
解决办法
687
查看次数

标签 统计

invalidation ×1

react-cache ×1

reactjs ×1