Replies: 1 comment
-
As an ugly hack, following code gets the job done, by forcing a navigation to go 1 level up and them coming back down, but as a side-effect it pollutes the browser history:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I've been trying to force a sub-route loader refresh programmatically by using
useNavigation
hook, but to no avail. Is there a way to do it in a straight forward manner? It's pretty well defined when loaders do get triggered, which is when the route changes. But I'd like to also reload a current (sub)-route without changing a route URL, or trying to hack around it like going back and forth in history, or doing full page refresh which will then load all the parent routes too, which I don't need.The reason for it is pretty simple, it's pretty convenient to load all the data that is needed for the given route in a loader, and use the pending element to show a busy indicator, without having to bake that logic into the component itself the route is going to render. But given that I have updated some data on the page (pushed to backend), I'd like to refresh the page that then fetches updated state from the backend, rather than programmatically updating the page with the new data. It would be super convenient to ask the (sub)-route to be fully reloaded, since then the loader will fetch most up to date data from the backend. Currently the alternative for me is to build that loading and busy state logic into a component, which is less convenient since loaders give me everything I need, except I have yet to find a way to force a page refresh that goes through a loader again.
Beta Was this translation helpful? Give feedback.
All reactions