score:4

Accepted answer

the error is pretty descriptive. you cannot pass parameter of type string into the usestate hook which expects number.

you're calling the setidpadre hook with the e.target.value variable, which is a string.

what you can do instead is convert the value into a number:

{ (e) => setidpadre( parseint(e.target.value) ) }

Related Query

More Query from same tag