-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Code example that introduces TypeError. #12210
Comments
@LAITONEN We have been fixing the very same issue a few days ago for the Popper component. We need to change this line |
@oliviertassinari I could. You think it is the typing that should be corrected, not the default value of this.state.anchorEl in the example (from null to undefined)? |
@LAITONEN I'm suggesting that we change - anchorEl?: HTMLElement | ((element: HTMLElement) => HTMLElement);
+ anchorEl?: null | HTMLElement | ((element: HTMLElement) => HTMLElement); |
* Added null as acceptable value of anchorEl #12210 (comment) * let's merge
The problem is here:
I have a TypeScript project, where I decided to use Menu Component. After copy-pasting the code from the documentation, I got this TypeError for Menu Component:
Which means that the value of
anchorEl
can not benull
, whereas the documentation implies that it could. Setting the value ofanchorEl
toundefined
solves the problem.Your Environment
The text was updated successfully, but these errors were encountered: