Home > Net >  React - map n times group of input fields and take their value into array of objects
React - map n times group of input fields and take their value into array of objects

Time:11-14

I am trying to map one react element for n times. Element consist two input fields: x and y.

I have managed to do this, but when I enter some value in x field, all x fields on all Element are getting that value.

Second part of problem is when I try to take values of input fields into array of objects (eg. [{x:10, y:20},{x:30, y:70},{x:100, y:5}]), there is error that "Map is not a function."

Here is code and CodePen link: Edit 74428251

  • Related