Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with useRouteLoaderData #15

Open
Ultimarii-sushant opened this issue Oct 23, 2024 · 2 comments
Open

Usage with useRouteLoaderData #15

Ultimarii-sushant opened this issue Oct 23, 2024 · 2 comments

Comments

@Ultimarii-sushant
Copy link

I have a multi layout application where I fetch the data in one of the layout.
The data fetched in this layout is used with useRouteLoaderData in child components.

Since the documentation recommends using the useCachedLoaderData, is there a way similar where I can get the data similarly in useRouteLoaderData - possibly with useCachedRouteLoaderData ?

Thank you for your hard work on this package (and all the videos on YT too!).

@chizidotdev
Copy link

Just ran into a similar bottleneck... I just moved all my data fetching logic to a parent layout hoping I could utilize Remix's in-built context with useRouteLoaderData, but there's no cached version of route loader data with this library...

I really love the abstraction I get from using remix-client-cache, would be great to have something for sharing the cached data across children routes.

@turntable-sami
Copy link

turntable-sami commented Dec 20, 2024

Ran into the same problem @AlemTuzlak . For now resolved by passing in the cached loader data into the outlet context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants