Skip to content

v27.0.0 breaks TypeScript typings #1163

Description

@hehex9

Describe the bug

  1. some components (Button*/Dialog/TextInput/FilterList/...) have incorrect type definitions, and ts keeps complaining:
Property 'css' is missing intype'{}' but required intype'Pick<TextInputInternalProps, "form" | "p" | "slot" | "style" | "title" | "pattern" | "children" | "type" | "theme" | "key" | "defaultChecked" | "defaultValue" | ... 317 more ... | "icon">'.ts(2741)
  1. callbacks like onChange/onKeyPress in TextInput are not giving us the right types, it will cause an error like:
Parameter 'e' implicitly has an 'any' type.ts(7006)

vscode shows the onChange's type definition is:

onChange?: (((event: React.FormEvent<HTMLSpanElement>)=>void)&((event: React.ChangeEvent<HTMLInputElement>)=>void))|undefined

which is not accurate

To Reproduce
codesanbox

Expected behavior
no error

Screenshots
codesanbox

Additional context
v26 was fine

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