Keep the value of an input in state, accepting the change event or a value.
This is custom React hooks, you need to follow the Basic Rules when you use it.
Pass the handler straight to onChange, or call it with a value.
const useInputState = <T>(initialValue: T) => [
T,
(value: T | ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void,
]