A custom React hook for managing the state of an input element.
const { value, onChange } = useInput('initial');<input value={value} onChange={onChange} /> Copy
const { value, onChange } = useInput('initial');<input value={value} onChange={onChange} />
The initial value of the input element.
An object containing:
value
onChange
A custom React hook for managing the state of an input element.
Example