A user wants to enter 12537 into a React HTML input[type="number"]
:
- “1”, my app paints the data visualization
- “12”, my app re-paints the data visualization
- “125”, my app re-paints the data visualization
- “1253”, my app re-paints the data visualization
- “12537”, my app re-paints the data visualization
- …
Is there a true onChange
somewhere in React (maybe usable but just under the API hood)?
I’ve done these and they work, but they are “off-script”.
useRef
and listen for the native HTMLonChange
.onBlur
+EnterKeyDown
as a substitute foronChange
.
4