0

I need to create an object like {Dogs: []} where "Dogs" is passed in as a variable. I need to add my new object to this.state.

Then, I need to add objects to the array I've created. The new objects are in the form

{Dogs: [{name: "Fido"}, {name: "Snoopy"}]}

In this stage, the strings "Fido", "Snoopy", will be passed in as variables, and "Dogs" is passed in as a variable as well.

The syntax is defying me...

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
Jim Kay
  • 91
  • 6

0 Answers0