Should useRevalidator be stable? #10702
-
I've got a hook which calls I'm currently chasing down some unnecessary re-renders, and my The docs imply that it's a singleton under the hood, so I'd assumed that we could rely on Have I misunderstood how this works? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
It will change on revalidations because it also returns |
Beta Was this translation helpful? Give feedback.
It will change on revalidations because it also returns
useRevalidator().state
which can change. But we should probably memoize it internally based onstate
so the object is stable on re-renders when a revalidation is not in progress.