Categories
Development

React add array to state array

I am new to React. In my state, I am trying to have an empty array initialized to store polygons. The structure I want to have is an array like this.state.polyList = [[dot1,dot2,dot3…],[dot1,dot2,dot3…]] I am trying to have a let newState = Object.assign({},this.state); let newValue = [points]; // “points” is [dot1,dot2,dot3…] console.log(newValue[0][0]); // able to […]