Mutate with key not causing fetcher to run #1488
Unanswered
ThiagoMaia1
asked this question in
Q&A
Replies: 1 comment
-
I did manage to reach the desired result using |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I have a HOC to encapsulate form components in order to not render them until the validation has been run, because if the form component gets initialized with cached data it won't be reupdated after the revalidation, something like this:
The idea is that when the isValidating turns true and then false, a validation has happened. I previously had implemented with a single boolean state variable "hasValidatedAtLeastOnce" and I thought it worked fine, but then I noticed that even when I use mutate() the isValidating becomes true and false one time before the fetcher function runs. What is that supposed to mean? Why is it that isValidating becomes false if the fetcher hasn't been run? What is being validated then?
Is this behaviour consistent enough that I can safely implement this just raising the required number of times to 2? Setting "shouldRevalidate" on mutate to true doesn't seem to make a difference either.
Beta Was this translation helpful? Give feedback.
All reactions