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] Use refs instead of findDOMNode #14829

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Mar 10, 2019

Fixes deprecation warning StrictMode.

Trivia: The original PR title started with [Pooper]. I still think that's funny.

@eps1lon eps1lon added the new feature New feature or request label Mar 10, 2019
@@ -171,6 +172,7 @@ class Popper extends React.Component {
return (
<Portal onRendered={this.handleOpen} disablePortal={disablePortal} container={container}>
<div
ref={this.tooltip}
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't think it would be that easy but it seems like findDOMNode(this) drills through portals. Confirmed this by setting a breakpoint in handleOpen and the attributes matched the props that were spread from <Popper {...spread} />.

@mui-pr-bot
Copy link

Details of bundle changes.

Comparing: a5b8011...8bfc5cb

bundle parsed diff gzip diff prev parsed current parsed prev gzip current gzip
@material-ui/core -0.00% +0.02% 🔺 362,777 362,775 92,213 92,230
@material-ui/core/Paper 0.00% 0.00% 68,878 68,878 20,170 20,171
@material-ui/core/Paper.esm 0.00% -0.04% 63,340 63,340 19,272 19,264
@material-ui/core/Popper -0.01% -0.03% 30,460 30,458 10,573 10,570
@material-ui/core/styles/createMuiTheme 0.00% 0.00% 17,284 17,284 5,700 5,700
@material-ui/core/useMediaQuery 0.00% 0.00% 2,471 2,471 1,035 1,035
@material-ui/lab -0.00% -0.00% 170,747 170,745 50,065 50,064
@material-ui/styles 0.00% -0.32% 57,220 57,220 16,273 16,221
@material-ui/system 0.00% 0.00% 17,041 17,041 4,493 4,493
Button 0.00% -0.01% 91,152 91,152 26,939 26,935
Modal 0.00% -0.01% 90,261 90,261 26,724 26,721
colorManipulator 0.00% 0.00% 3,232 3,232 1,298 1,298
docs.landing 0.00% 0.00% 51,908 51,908 11,302 11,302
docs.main -0.00% -0.01% 647,808 647,790 201,557 201,543
packages/material-ui/build/umd/material-ui.production.min.js +0.01% 🔺 +0.05% 🔺 311,179 311,213 85,197 85,240

Generated by 🚫 dangerJS against 8bfc5cb

@eps1lon eps1lon marked this pull request as ready for review March 10, 2019 18:40
@oliviertassinari
Copy link
Member

oliviertassinari commented Mar 10, 2019

It's not too far from Poppers ✌️.

@oliviertassinari oliviertassinari merged commit 604df9e into mui:next Mar 11, 2019
@eps1lon eps1lon deleted the feat/Popper/no-findDOMNode branch March 11, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants