Skip to content

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