useInputState

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.

General

Pass the handler straight to onChange, or call it with a value.

APIs

useInputState

const useInputState = <T>(initialValue: T) => [
  T,
  (value: T | ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void,
]
Edit this page on GitHub