【发布时间】:2022-11-22 17:30:55
【问题描述】:
我无法弄清楚如何更新我的资源以重新呈现。
例如:
...Lazy import('./childComponent'
const resource = fetchData()
// Main component:
return (
<Suspense>
<Item />
<Item />
</ Suspense>
)
// Child component:
const data = resource.getItem.read() <--- How can I update this data? Normally this would be a useEffect dependancy rerendering the component, doing a new call to the API.
function handleDeleteItem(id){
// Function to delete through API
}
return <Item />
谢谢!
【问题讨论】: