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
rival-black•17mo ago
I think just calling
router.state.matches
on your router will get you quite far
there, each match has a loaderData
for exampleadverse-sapphireOP•17mo ago
yeah, that's what i needed, thanks. Is there an example in the docs about this?