-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[material-ui][Dialog] Fix crashing of DraggableDialog demo #44747
Conversation
Netlify deploy previewhttps://deploy-preview-44747--material-ui.netlify.app/ Bundle size report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if we have to suppress the null type with exclamation mark (!) here. Since the nodeRef won't be null anyway, only its "current" member be nullable. I suggest you to not use it for safety reason.
Nevermind, it just gone. Thanks
d35d3cf
to
5208e85
Compare
return ( | ||
<Draggable | ||
nodeRef={nodeRef as React.RefObject<HTMLDivElement>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nodeRef doesn't accept a null
type. If null
is removed from the nodeRef declaration, TypeScript throws an error in the Paper component. So i used type assertion as a workaround.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, FYI react-draggable last published version is on last year. I'm not sure if we have to wait for them to merge the PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah! My intention wasn't for us to wait, just to be aware of it.
Thanks ~ @sai6855 |
This is now fixed on https://mui.com |
closes #44732
Error occurs because react-draggable is using the deprecated findDOMNode method. On updating code to use refs fixed the issue
before: https://mui.com/material-ui/react-dialog/#draggable-dialog
after: https://deploy-preview-44747--material-ui.netlify.app/material-ui/react-dialog/#draggable-dialog