Skip to content

Tag: react-redux

How to update the state in React Redux?

I’m using a reducer to set the state in Redux. My state currently looks something like this. In my old reducer, I was just getting the conversations array and setting that but now I need access to the activeConversation string as well. Therefore, I decided to use my root reducer which combines everythin…

How to find an element by id in nested arrays

i trying create reply to comments in my project, and I have some problems with adding comments to reducer, i am trying to add an reply without reloading the page. My comments looks at: It’s my reducer, now i trying write to console: I can’t think of how I can iterate through my array to add a comm…