score:0

Accepted answer

the issue is event.target.value gives a string and you are passing that as a size which is supposed to be a number. to fix simply convert that into a number.

handlearraysizechange = (event: any) => {
  this.setstate({arraysize: number(event.target.value)});
}

score:0

i tried using the above function in this url: https://codesandbox.io/s/brave-bardeen-7slbh?file=/src/app.js

i console logged the array & i can see it's working as expected


Related Query

More Query from same tag