Accessing route data outside react components and hooks
Is there a way to access route's data (and params and searchparams, etc...) outside react components and hooks like there is for tanstack query via
getQueryData?2 Replies
optimistic-gold•2y ago
I think just calling
router.state.matches on your router will get you quite far
there, each match has a loaderData for examplexenial-blackOP•2y ago
yeah, that's what i needed, thanks. Is there an example in the docs about this?