Utilizing Material-UI's TextField
alongside react-hook-form
to monitor inputs has raised an issue for me.
I have observed that regardless of the input type, it always returns a string.
This creates conflicts with the data types I am using in my codebase.
I have researched various methods to address this problem on the side of react-hook-form
, such as manipulating the returned data, but I have not found any information on making TextField return a different type based on its usage.
It surprises me, especially considering that, from what I comprehend, valueAsNumber
is natively available on HTML inputs (https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement)