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
I have been stuck on this problem for 6 hour finally able to solve it i thought i share it with the community
So i have parent component A and child component B when i post data to database will led to the parent component A to render and lead to child component to re-render and lose all the data
So this a key point to consider
1- Swr is sync with db when change made to the db the swr will reload data
2- Swr is sharing data across the app using appcontext
So iam fetching the same url ex {url:/orders} in parent component and child component (my bad)
So when i post data to server the swr will notice and reload the new data and because the data is shared across the app every component fetching the same data will rerender do to state change
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.
-
I have been stuck on this problem for 6 hour finally able to solve it i thought i share it with the community
So i have parent component A and child component B when i post data to database will led to the parent component A to render and lead to child component to re-render and lose all the data
So this a key point to consider
1- Swr is sync with db when change made to the db the swr will reload data
2- Swr is sharing data across the app using appcontext
So iam fetching the same url ex {url:/orders} in parent component and child component (my bad)
So when i post data to server the swr will notice and reload the new data and because the data is shared across the app every component fetching the same data will rerender do to state change
Beta Was this translation helpful? Give feedback.
All reactions