Skip to content

Commit

Permalink
Code review
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwooding committed Apr 12, 2019
1 parent 5103909 commit 8459d60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/material-ui/src/Tooltip/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,15 @@ function Tooltip(props) {
// Fallback to this default id when possible.
// Use the random value for client side rendering only.
// We can't use it server-side.
defaultId.current = `mui-tooltip-${Math.round(Math.random() * 1e5)}`;
if (!defaultId.current) {
defaultId.current = `mui-tooltip-${Math.round(Math.random() * 1e5)}`;
}

// Rerender with defaultId and childNode.
if (openProp && !mountedRef.current) {
if (openProp) {
forceUpdate(n => !n);
}
}, [mountedRef, openProp]);
}, [openProp]);

React.useEffect(() => {
return () => {
Expand Down

0 comments on commit 8459d60

Please sign in to comment.