vadimdemedes/ink-text-input

UncontrolledTextInput wrong typings & docs

jrson83 opened this issue · 0 comments

The docs describe the usage of UncontrolledTextInput:

<UncontrolledTextInput onSubmit={handleSubmit} />

With an optional prop initialValue.

The prop typings are wrong. The required/expected prop instead of onSubmit is onChange and it does not accept initialValue at all, instead requires a value.

So the required syntax is:

<UncontrolledTextInput value="whatever" onChange={() => { console.log('whatever')}} />

Also Except should be replaced with Omit to fix:

interface UncontrolledProps extends Omit<Props, 'value' | 'onChange'> {
  /**
   * Initial value.
   */
  initialValue?: string
}