0

I have the following state:

this.state = {
 teams: [ 
  {'name': 'Team1', teamMembers: ['adam', 'jack'] },
  {'name': 'Team2', teamMembers: ['peter', 'ryan'] }
 ]
}

I'd like to update this state to the following:

this.state = {
 teams: [ 
  {'name': 'Team1', teamMembers: ['adam'] },
  {'name': 'Team2', teamMembers: ['peter', 'ryan', 'jack'] }
 ]
}

How can I accomplish this?

Heretic Monkey
  • 11,078
  • 7
  • 55
  • 112
user1893649
  • 139
  • 1
  • 10
  • 1
    There is no JSON involved here. See [What is the difference between JSON and object literal notation?](https://stackoverflow.com/questions/2904131/what-is-the-difference-between-json-and-object-literal-notation). – Heretic Monkey Aug 20 '21 at 20:12

0 Answers0