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

[Popper] Update TypeScript definitions #12161

Merged
merged 2 commits into from
Jul 16, 2018
Merged

[Popper] Update TypeScript definitions #12161

merged 2 commits into from
Jul 16, 2018

Conversation

Slessi
Copy link
Contributor

@Slessi Slessi commented Jul 16, 2018

  • Add missing transition prop
  • Add null as option to anchorEl (strictNullChecks will complain that null is not valid)
  • Add childProps def for children

@Slessi Slessi changed the title Update Popper.d.ts Update Popper typings Jul 16, 2018
Copy link
Member

@oliviertassinari oliviertassinari left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning that up.

anchorEl?: HTMLElement | ((element: HTMLElement) => HTMLElement);
children: () => React.ReactElement<any> | React.ReactElement<any>;
transition?: boolean;
anchorEl?: null | HTMLElement | ((element: HTMLElement) => HTMLElement);
Copy link
Member

Choose a reason for hiding this comment

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

How is ? not enough?

Copy link
Contributor Author

@Slessi Slessi Jul 16, 2018

Choose a reason for hiding this comment

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

With strictNullChecks or strict mode turned on, ? only allows for passing undefined, but passing null does work too.

In reality, any developer using strict should be capable of figuring out that they can just use undefined but documentation example was using null so dunno thought I'd add it.

Not really important.

@oliviertassinari oliviertassinari added typescript component: Popper The React component. See <Popup> for the latest version. labels Jul 16, 2018
@oliviertassinari oliviertassinari changed the title Update Popper typings [Popper] Update TypeScript definitions Jul 16, 2018
@oliviertassinari oliviertassinari merged commit c4dfc4a into mui:master Jul 16, 2018
@oliviertassinari
Copy link
Member

@Slessi Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Popper The React component. See <Popup> for the latest version. typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants