Is there any way to setQueryData() while deleting elements from the existing array stored in the store? #4458
Unanswered
sonjaerock
asked this question in
Q&A
Replies: 2 comments
-
I don't understand the question and the reproduction is far from minimal. Can you elaborate please? |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is most likely because you didn't update the data immutably. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Removed todo rendered via setQueryData() in onMutate() after calling delete api in sample todolist. It remains deleted in the store, but it is still displayed.
Is there any way to setQueryData() while deleting elements from the existing array stored in the store?
Your minimal, reproducible example
https://codesandbox.io/s/long-tdd-iur84y?file=/src/Components/TodoList.tsx
Steps to reproduce
Expected behavior
rerender
How often does this bug happen?
No response
Screenshots or Videos
No response
Platform
OS: windows
Browser: chrome
react-query version
v3.39.2
TypeScript version
v4.8.4
Additional context
test
Beta Was this translation helpful? Give feedback.
All reactions