Form data binding with repeated forms in React

I see that you are mutating the state directly by using

let formValues = this.state.formValues; 
formValues[name] = value; 

One way to alleviate this issue is to spread the formValues before assigning

let formValues = {...this.state.formValues}; 

or you can use Immer

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top