TanStackT
TanStack11mo ago
4 replies
dramatic-maroon

fetching data in beforeLoad and injecting it in context

Hey, i've recently started migration from react-router.
Still wrapping my head around all the concepts, i'm using context as a vehicle for injecting data by fetching in beforeLoad and then returning data to be available for all the child routes in context. I find this very convenient but am not sure is this a good practice?
Was this page helpful?