Skip to content
Discussion options

You must be logged in to vote

the code that you've posted looks fine. not having the correct query key would've been my first instinct. be aware of the types. maybe the number 19 should in fact be the string 19? (just guessing here). Otherwise, if you put it in a codesandbox example, I'm happy to take a look. But as you can see in the existing examples, invalidation like that works (see e.g. here: https://react-query.tanstack.com/examples/optimistic-updates)

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
5 replies
@Spider101
Comment options

@Spider101
Comment options

@TkDodo
Comment options

@Spider101
Comment options

@TkDodo
Comment options

Answer selected by Spider101
Comment options

You must be logged in to vote
1 reply
@JasonKleban
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants