new QueryClient instantiated in a function component
Hi, so I want to trigger toasts on errors, and the toasts can only be controlled through hooks. In this case, instead of instantiating the query client globally, I made a wrapper rq provider which has access to the toast provider:
So my question is: is it still okay to instantiate a client in this way? There's only 1 way to trigger this provider rerender - which is by changing the theme (as my theme provider and toast provider are coming from the same library)
So my question is: is it still okay to instantiate a client in this way? There's only 1 way to trigger this provider rerender - which is by changing the theme (as my theme provider and toast provider are coming from the same library)