Replies: 1 comment
-
Late response and I'm just making a guess since I'm not an expert with SWR but I would assume that it's just returning the cached value. If you need it to get a new value each time, you can look at someone with a similar problem here: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, i'm struggling to understand how SWR works after all. Let's start with overview what I have:
Parent.jsx - component with button. When I press button, the
<Children />
component is mountedChild.jsx - component with has to fetch data from API. Also it can be closed with a button, which use method from
Parent.jsx
Well, when I first click button, so
Child
being mounted for the first time, everything is working as expected:...
But, if I close (press button) and open child component again, the behavior becomes very illogical:
...
You can play with this stuff here - Codesandbox (Console output worked for me only if open preview in separated tab)
Can someone explain me why swr not refetching normally?
Beta Was this translation helpful? Give feedback.
All reactions