1

I'm having trouble figuring out how I can update my resource to rerender.

For example:

...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 />

Thnx!

ImNotADev
  • 11
  • 2

0 Answers0