[SOLVED] Refetch not occurring after router.back (React Native)
Version "@tanstack/react-query": "^5.37.1",
I'm not seeing a refetch automatically occurring after the data is updated.
I have a Project details screen that leveraged useQuery to fetch the data for display:
Also within this screen the user is presented a button that shows a modal to edit:
When the user updates their form and saves it calls an update mutation:
/(authenticated)/projects/create.tsx:
I'm correctly seeing the onSuccess run because it calls router.back() & updates the object in the DB. However, when presented back to the ProjectDetails screen it doesn't re-fetch to get the updated object.
Any thoughts?
Appreciate the assistance!
I'm not seeing a refetch automatically occurring after the data is updated.
I have a Project details screen that leveraged useQuery to fetch the data for display:
Also within this screen the user is presented a button that shows a modal to edit:
When the user updates their form and saves it calls an update mutation:
/(authenticated)/projects/create.tsx:
I'm correctly seeing the onSuccess run because it calls router.back() & updates the object in the DB. However, when presented back to the ProjectDetails screen it doesn't re-fetch to get the updated object.
Any thoughts?