Replies: 1 comment
-
You can import the internal cache doing: import { cache } from "swr"; And then read a value using However, I'm not sure what do you plan to achieve, do you want to effectively prevent SWR from revalidating your data? If so, why use SWR? |
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
-
currently in page I use this
const { data, error, mutate } = useSWR('/api/', fetcher)
in child component I use this so I can get the values
const { data, error, mutate } useSWR('/api', fetcher, { revalidateOnMount: false}
Is there anyway I can access the current key value, check if the key is "fetched before" before fetching?
pseudo code
const { data, error, mutate } = useSWR('/api', (currentkeydata) => fetcher(check if currentkeydata exist before fetch))
Beta Was this translation helpful? Give feedback.
All reactions