When i use map().I got this error "this.props.getCart.items.map is not a function"
{
"70":
[
{
"numberPick": 13,
"numberPrice": 200
},
{
"numberPick": 44,
"numberPrice": 300
}
],
"81":
[
{
"numberPick": 31,
"numberPrice": 50
},
{
"numberPick": 22,
"numberPrice": 90
},
{
"numberPick": 38,
"numberPrice": 50
}
]
}
This is how i get it #redux
var newData = (state.items[action.parent] === undefined)?[]:state.items[action.parent]
state = {
...state,
items:{
...state.items,
[action.parent]:[...newData,{
numberPick:action.item,
numberPrice:action.price
}]
}
}
Results that i want.Should be like this
Your parent id is 70:
first: itemID = 13 and price = 200
second: itemID = 44 and price = 200
Your parent id is 81:
first: itemID = 31 and price = 50
second: itemID = 22 and price = 90
Can anyone please help me.Thank you so much