#Best way to share data between nested loaders?

1 messages · Page 1 of 1 (latest)

hidden girder
#

Hello 👋 I'm currently working through how to structure my app in a neat way. One thing that often comes up is the need to re-fetch my user in every loader. This feels quite inefficient when i already have a wrapper loader in a _authenticated.tsx file since most of the time i'd be fetching the user twice. Is there any recommended way to forward the user loaded in my _authenticted.tsx loader to a loader in _authenticated/somePage.tsx?

If there's no official good way to do it, I'm thinking it may be possible to implement something using some magic express middleware glue? Suggestions welcome and i'd love to hear how others have solved similar issues :)

Thanks in advance!

wintry stone
#

Hey