Replies: 2 comments 1 reply
-
In your case, you can use the |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you for your answer @koba04 Even with useSWRImmutable, it wont fetch the first time if |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey guys,
First of all, thank you for this amazing library!
I have spent one hour trying to understand what i feel its bug but its actual an unexpected behavior in my opinion.
I have
SWRConfig
into my_app
file (i'm using NextJS) withrevalidateOnMount:false
because i do not want my components to revalidate on mount. I just want them to validate once, right?So i naturally set
revalidateOnMount
to set to false.Now into my component, i will want to request my api.
This won't work if don't set manually
revalidateOnMount
totrue
.This is extremely confusing for me, i do not want to constantly request my API.
I was expected to fetch at least the first time (to fill up the cache) and then it wont fetch again because i have configured it like it.
Can you guys tell me why ? Am i doing something wrong?
PS: i only want to use client data fetching.
Thank you so much for your help!
Beta Was this translation helpful? Give feedback.
All reactions