How to use hooks in react-query global onError handler
Is there any way to use hook in onError handler since the queryClient is outside of a Component?
For example how i could open a Modal or a Notification component.

3 Replies
continuing-cyan•3y ago
move the QueryClient into the component and into react useState
continuing-cyan•3y ago
useState for one-time initializations
Why you shouldn't rely on useMemo for guaranteed referential stability but prefer useState instead
conscious-sapphireOP•3y ago
Oh thank you!! This is very helpful