state.filter using redux-toolkit and component re-rendering #3526
joshtheflame
started this conversation in
General
Replies: 1 comment 1 reply
-
You are using the action generator wrong, you don't call those with a -dispatch(taskActions.DeleteTask(...mystate, xid));
+dispatch(taskActions.DeleteTask(xid)); |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
I am developing a small Task application for react.js learning. When user clicks on "x' delete task it calls a middleware (node.js) based API and delete the task then apply filter on map to make the task disappear from the UI. I am using redux tool kit and using dispatch method where I am setting the same state.filter but its not making the task disappear but when I refresh the page it gets disappear. Ideally my ask is when I delete the task it should call dispatch, apply filter on state and re-render component. Please advise
Following is the code:
redux toolkit store code:
Tasks Component source:
Task Component Source(single task rendering) which is being called from above "Tasks" component
Beta Was this translation helpful? Give feedback.
All reactions