You basically use this hook the same way you use React.useState but you have to pass in a ref target when you initialise it also it returns 3 items rather than 2, [state, setState, callStateChange].
That last function will change the value of the input and trigger an event for your onChange to pick up and deal with.
Here's a working example.
Unless I've totally misunderstood again 😅
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
OK, I think I understand the problem now 😊
I think this custom hook will fix your issues.
You basically use this hook the same way you use
React.useState
but you have to pass in a ref target when you initialise it also it returns 3 items rather than 2,[state, setState, callStateChange]
.That last function will change the value of the input and trigger an event for your
onChange
to pick up and deal with.Here's a working example.
Unless I've totally misunderstood again 😅