Skip to content

Inaccurate type for TextInput's onChange property #1377

Description

@jclem

Describe the bug

I expected the onChange property of TextInput to have the same type as JSX.InstrinsicElements['input'], but it appears that currentTarget on the event is more than HTMLInputElement:

CleanShot 2021-08-11 at 15 04 56@2x

To Reproduce
Steps to reproduce the behavior:

  1. Create a component with TextInput whose value is a piece of string state
  2. Try to set the string state with onChange={e => setState(e.currentTarget.value)}

Expected behavior

No type error occurs.

Screenshots

See above with the current typing for onChange.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions