Question about loader / beforeLoading
So what do I do in this type of case :
If I put my dataloading in the beforeLoad of the
route.tx, I can pass it in the context and all is fine, the children paths have assess to it. But, the beforeLoad seems to refetch every navigation, but I don't want to do that since the information only changes when the $id changes.
I know that the loader() are run all at the same time for the routes so the children cannot access the data of the parent in their loader(), so what should I do ?2 Replies
sensitive-blue•3mo ago
load the data in beforeLoad using tanstack query and cache it using that
optimistic-goldOP•3mo ago
and let the beforeLoad get called everytime, but it will hit cache so we good ?