I understand this has been asked before but so far no answers except someone making a syntax mistake. I have verified this against every tutorial I’ve seen online and I can’t find the issue. It seems to be coming from the fullfilled extraReducer In the component, nothing weird, and yes everything is imported You can see in my image below
Tag: redux
how to update an object within an array during an asyncThunk.fulfilled action in Redux
I have an AsyncThunk method named likePost when a user clicks like on a post it will send this action via dispatch. The method runs fine, and in my database the Post is updated successfully, but I can’t get Redux to update the Post that is liked during the .fulfilled method. Here is what I’m currently working with: Answer Instead
redux is not re-rendering component with React 18
I have a custom hook which handles global data fetching based on user authentication. the hook is like this: but since I am using React 18 strict mode (in NextJS), the useEffect only runs twice with userState === “loading” value and won’t run when state updates. I’m not sure if I should give more details of my code. If you
Best way to use Redux and local state in react native to optimize performance?
I am using redux to manage a global state and sagas for async server calls in a react native app. Can it improve the performance / minimize rendering to split the calls to redux state when connecting a component to the redux store? E.g. a big object in the redux store is composed of many smaller ones. {bigObject : {small1,
how to import child’s state to parent component
I want to import the child state to my parent component in order to change DOM, but I don’t know if its possible or how to do it shall I use Redux in this case ?? if not what possibly I must do to do that Answer You can create state in parent component and pass it to child component
Cannot read properties of undefined (reading ‘map’) after adding combineReducers
I combined two reducers functions one returning a list of movies and one that I am building to handle the logic enabling users to add a movie to a ‘favorites list’. If I do not combine these two reducers and just have movieReducer I get all the movies I have, however, the moment I combined these two I get the
How to pass in a string as a single value and not a split value
I have a function called onClick of a div that calls a dispatch function, and passes in the target value into it (i.e e.target.value). The value being passed in, is being stored in an array. However, I noticed something weird going on. In the array the value is being passed into, the first value is stored wrongly. For instance if
how to build object JS
I have an array of booking and types. From these two arrays I need to build an object. Everything works great, except for the types. Types return an array in each object (same). How can you return the correct object? Answer found a solution to my problem. It was enough to add indexes
react router dom pushing user before finishing action
I’m building a Reddit clone with MERN and am using redux and react in frontend So the problem is when a user tries to register it dosen’t push the user to “/login” route. This is not an issue with redux (i think) because after pressing the “register” button again with a different email it works still here is the redux
Uncomplete payload | React & Redux Toolkit
I have a big problem,maybe it’s not so big but i dont sleep for almost 24h because of it.I barely finished this Slice,but now,when i submit the data,i get only the automatically set id.. So,to be clear.I have a skill component where i have 2 input forms and a button,i need to retrieve data from both inputs,and then,when they are