query icon indicating copy to clipboard operation
query copied to clipboard

replace custom context with custom queryClient

Open TkDodo opened this issue 3 years ago • 0 comments

context

in v4, we introduced the possibility to pass a custom context to all react-query hooks. This allowed for proper isolation when using MicroFrontends. See the migration guide for examples and details.

However, context is a react only feature. All that context does is give us access to the query client. We could achieve the same isolation by allowing to pass in a custom query client instead of a custom context that then serves the query client.

vue-query does have this api already, so it makes sense to streamline it in react as well.

see also:

  • https://github.com/TanStack/query/discussions/4360

proposal

  • replace custom context param on react hooks with custom queryClient param

TkDodo avatar Dec 23 '22 07:12 TkDodo