why, after clicking the updatestate button, doesnt update the state to sliced array that is ['usa','china'] but instead updates to entire array in console.log, Yet on the page it shows it correctly.?
CodePudding user response:
Lines 10 and 11 are called mutating states, which goes against React's recommended way to update the state, so it may or may not work.