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