Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing: defaultValue Typescript Types #2668

Closed
amiller-gh opened this issue Jul 30, 2020 · 2 comments
Closed

Missing: defaultValue Typescript Types #2668

amiller-gh opened this issue Jul 30, 2020 · 2 comments
Labels

Comments

@amiller-gh
Copy link

Reproduction

Preact 10.4.6 does not contain typescript types for React's defaultValue despite being supported by preact/compat

Steps to reproduce

Try to use it in a Typescript project 🙂

I was able to work around the missing types by adding this override declaration to my project:

declare module 'preact/src/jsx' {
  /* eslint-disable-next-line @typescript-eslint/no-namespace */
  namespace JSXInternal {
    interface HTMLAttributes<RefType extends EventTarget = EventTarget> {
      defaultValue?: string;
    }
  }
}

Expected Behavior

It builds!

Actual Behavior

It doesn't...

Property 'defaultValue' does not exist on type 'HTMLAttributes<HTMLInputElement>'.
@Rafi993
Copy link
Contributor

Rafi993 commented Nov 25, 2020

Hello there, If this issue is not taken I would like to help

@JoviDeCroock
Copy link
Member

Resolved by 3957522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants