I'm making a card game and trying to make a modification on a card.
My schema struct is somewhat like that:
field -> rows -> spots -> playerCard
My problem is, when I try to modify the object, the schema don't update, but when I move my card in the field for example, the values that I applied to the card finally appears.
I'm modifying the state like that:
One workaround that I've been using is creating and entire new spot object (parent of my playerCard) and assiging it, this way the schema is properly updated.
The workaround is like this:
const tempSpot = new FieldSpot(spot.index, spot.ownerType)
tempSpot.playerCard = spot.playerCard
this.state.field.rows[rowIndex].spots[spotIndex] = tempSpot
Is there a way to make the state update without creating a new object?
Thanks in advance.