Is there a way to listen for the completion of router.push navigation in Next.js 14
Unanswered
Polar bear posted this in #help-forum
Polar bearOP
I have a search button that navigates to a URL using router.push, which fetches data server-side.
I want the button to display a loading state (e.g., spinner or text) while the data is being fetched.
How can I detect when the data fetching has completed so I can stop the loading state?
I want the button to display a loading state (e.g., spinner or text) while the data is being fetched.
How can I detect when the data fetching has completed so I can stop the loading state?