jeudi 25 février 2021

how to set nested object in reducer with keys as input values in react?

enter image description here

is it possible to declare like this ....if so im getting typeerror of undefined property for tablo.

i need the value to look like this

{
"dine":{
  "21":{
    "10":{"count":1},
    "12":{"count":2},
  },
  "10":{
    "10":{"count":1},
    "12":{"count":2},
  }
},
"someother_name":{
  "21":{
    "10":{"count":1},
    "12":{"count":2},
  },
  "10":{
    "10":{"count":1},
    "12":{"count":2},
  }
}

}




Aucun commentaire:

Enregistrer un commentaire