I want to share state fetched from the backend between components, just like I would using redux. Specifically, once a user is logging in, the response he gets includes settings, notifications and recent posts. How do I distribute those across components using urql? I want to avoid fetching all this data in separate requests
Asked
Active
Viewed 151 times
1 Answers
0
From what I've found on github urql has no local state (like apollo has apollo-link-state
), but only cache.
You could either cache the data or:
- use React Context
- store the data in localstorage

mehowthe
- 761
- 6
- 14
-
I don't want to use local state though. I want to pass remote data between components. Although I'm not sure if that actually makes a difference – Tobi Feb 25 '21 at 20:51