Skip to content

Conversation

swyxio
Copy link
Collaborator

@swyxio swyxio commented Aug 22, 2020

closes #128 cc @pavloko

leaving open for a day or so for comments as i still dont feel confident about this one but it works in ts playground

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React.ButtonHTMLAttributes includes the type:

-export interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
+export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
  specialProp: string;
}

-- TypeScript playground

HTMLAttributes is for global attributes and type isn't one. For attributes specific to certain host elements we have specialized interfaces.

@swyxio
Copy link
Collaborator Author

swyxio commented Aug 22, 2020

gotcha, thank you!

@swyxio swyxio requested a review from eps1lon August 22, 2020 17:50
@swyxio swyxio requested a review from eps1lon August 24, 2020 00:25
@swyxio swyxio merged commit 2201cea into main Aug 24, 2020
@swyxio swyxio deleted the addressHTMLPropsissue branch August 24, 2020 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Basic] React.HTMLProps doesn't work
2 participants