T
TanStack11mo ago
conscious-sapphire

How to refetch/invalidate router data?

I want to revalidate router data after an API change, There is any way I can easily force the router loader to refetch the data and the child components to updated using the useRouterData?
2 Replies
rival-black
rival-black11mo ago
const router = useRouter(); router.invalidate();
conscious-sapphire
conscious-sapphireOP10mo ago
@aurindo neto thanks it worked, therefore tanstack router is scrolling it to the top once we call it

Did you find this page helpful?