Please help me to get the property of the embedded object React redux:
{
"id":1
"name":"Jonh"
"pets": {
"namepets": {
"String":"King-kong"
"Valid": true
},
"age": {
"String":"11",
"Valid": true
}
}
}
If i write console.log(this.props.user.pets), I see this object in my console, but I write console.log(this.props.user.pets.namepets).
I have this error:
TypeError: Cannot read property 'namepets' of undefined
How do I get this value?
console.log(this.props.user.pets)cannot output an object. Consider providing a way to replicate the problem.