Skip to content

[enzyme] fix broken usage of React.HTMLAttributes interface due to recent changes to [react] - #18269

Merged
weswigham merged 1 commit into
DefinitelyTyped:masterfrom
nocoolnametom:fix-enzyme-react-type-reference
Jul 21, 2017
Merged

[enzyme] fix broken usage of React.HTMLAttributes interface due to recent changes to [react]#18269
weswigham merged 1 commit into
DefinitelyTyped:masterfrom
nocoolnametom:fix-enzyme-react-type-reference

Conversation

@nocoolnametom

@nocoolnametom nocoolnametom commented Jul 20, 2017

Copy link
Copy Markdown
Contributor
  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

If changing an existing definition:

The interface for React.HTMLAttributes has been broken apart into multiple interfaces (as of @types/react-15.0.38), each specific to a particular DOM element type (SelectHTMLAttributes, TdHTMLAttributes, etc), and the unified interface with all of the possible DOM element attributes is now AllHTMLAttributes. When running .find() with a selector the returned object, which could be any element, has a type with the declared properties of HTMLAttributes which is now limited to only those props in common between all DOM elements. By changing the interface imported from React as the "default" collection of attributes this PR preserves the generic return type of .find() and other functions.

This is my first PR to DefinitelyTyped. I've tried to follow the template and README but if there's anything else I should do please let me know and I'll take care of it immediately.

…ibutes interface introduced in @types/react-15.0.38
@dt-bot

dt-bot commented Jul 20, 2017

Copy link
Copy Markdown
Member

types/enzyme/index.d.ts

to authors (@MarianPalkus @NoHomey @jwbay @huhuanming @MartynasZilinskas Cap3 (account can't be detected)). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

@nocoolnametom nocoolnametom changed the title Enzyme: Updating React.HTMLAttributes used by Enzyme to new React.AllHTMLAttributes interface introduced in @types/react-15.0.38 [enzyme] fix broken usage of React.HTMLAttributes interface due to recent changes to [react] Jul 20, 2017

@huhuanming huhuanming left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@huhuanming

Copy link
Copy Markdown
Contributor

👍

@typescript-bot

Copy link
Copy Markdown
Contributor

Approved by a listed owner. PR appears ready to merge pending express review by a maintainer.

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.

7 participants