Skip to content
Discussion options

You must be logged in to vote

In the past, without TanStack query, I'd just update the state, looking for the element with the ID I just clicked and modifying it or taking it out of the list or whatever.

You’re still basically just doing that. The code gets verbose because you have to know that you have to take it out of the list instead of just updating a value.

The thing you are doing that I think is “too much” is to iterate over all lists and update all of them. The only list that matters for the update is usually the one the user is currently on. Without TanStack Query, you only have the current data in state, so you don’t have the chance to manually update other lists, like ones with different filters.

But you …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by spasmodiumspam-web
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants