Reactjs – Why does this component not re-render when i use array.push instead of using spread operator in the addToArray method
I don't understand why the component Form does not re-render when i called setInfoArray by passing a new array created using the push method. When i logged infoArray after submitting the form, the array was updated but the component did…