You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the local state sharing example in the repo, it shows that you can share data between components, but then assigns the initialData again from a static array. I don't understand how that helps. I was expecting that if I load the data in my root component, that I should be able to retrieve it again from a child component. Does that make sense? I made an example in codesandbox here (I also posted to SO, but there are very few followers of SWR there)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the local state sharing example in the repo, it shows that you can share data between components, but then assigns the initialData again from a static array. I don't understand how that helps. I was expecting that if I load the data in my root component, that I should be able to retrieve it again from a child component. Does that make sense? I made an example in codesandbox here (I also posted to SO, but there are very few followers of SWR there)
https://codesandbox.io/s/useswr-global-cache-example-forked-8qxh7?file=/pages/index.js
Beta Was this translation helpful? Give feedback.
All reactions