Skip to content
Discussion options

You must be logged in to vote

no, this is out of scope for react-query. There are already lots of ways to handle global client state. My recommendation is to use the url, or zustand for this.

But introducing these client state management tools brings much burden to us

Not sure I understand that, it's like 5 lines of code with zustand, or even less if you use an atom from jotai:

import { atom, useAtom } from 'jotai'

const sharedQueryKeyAtom = atom(['my', 'key'])

function MyComponent() {
  const [sharedKey, setSharedKey] = useAtom(sharedQueryKeyAtom)
}

that's it.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@s33h0w
Comment options

@TkDodo
Comment options

@s33h0w
Comment options

@TkDodo
Comment options

@s33h0w
Comment options

Answer selected by s33h0w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants