-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Should a fragment container receive initial data from local cache, or will it always start in a "loading" state? #2046
Comments
Could you verify this? It most likely fetches data again assuming if (props) return <DataComponent/>;
if (error) return <ErrorComponent/>;
return <LoadingComponent/>; If you want it to look for data in cache first, use this package. If you want to "disable" garbage collection (aka |
@graingert |
I replied in #2296. What @robrichard explained here is accurate, so I'll go ahead and close this for now. Feel free to re-open if you have other questions! Thanks! |
@robrichard Any way to get it to avoid this check and just render whatever data is |
Hi folks,
I've got a nav bar fragment container component. The nav bar shows the current active user's name. This is fetched using a static GraphQL query like follows ...
Once this is fetched, it doesn't need to be re-fetched and can come from local cache. So, I was expecting the fragment container to immedietly provide this data to the underlying component. It looks like the underlying component is not being provided the data on first render, though.
I don't know that Relay is actually requesting the data again, but I am seeing the component render its "loading" state first. Basically, the fragment container is not fetching from cache and providing data on first render.
Is this how it should work or is there some requirement for local caching to work this way?
Thanks!
The text was updated successfully, but these errors were encountered: