Now I'm working in react-redux. I'm trying to get questions from state one-by-one. Generated unique ID to store the questions in the state, after user submits,answer also store with the question.
Uniqueid: { Question: question goes here, Answer: '' }
React component to render the question. I used selector in the mapstatetoprops to select question from state.
Now is my question: Selector triggers first time perfectly. After user submits the question answer also updated. After that, selector not triggering, I can't find why?
I'm still seeing activity in this page. Redux selector can't recognize changes in the object of object or array of objects. See the below example.
{firstName:"John", lastName:"Doe", age:50, eyeColor:"blue"}
Selector can recognize the changes in the above object.
{
firstName:"John",
lastName:"Doe",
featuer: {
age:50,
eyeColor:"blue"
}
}
If you made changes in the featuer
object selectore won't recognize the changes. Same thing goes for the below array object too.
[
{
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
},
{
firstName:"John",
lastName:"Doe",
age:50,
eyeColor:"blue"
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With