File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ class EllipisWithTooltip extends React.Component {
17
17
this . state = {
18
18
hasOverflowingChildren : false ,
19
19
text : undefined ,
20
+ prevPropsChildren : props . children ,
20
21
} ;
21
22
this . updateOverflow = this . updateOverflow . bind ( this ) ;
22
23
}
@@ -35,9 +36,12 @@ class EllipisWithTooltip extends React.Component {
35
36
}
36
37
}
37
38
38
- componentWillReceiveProps ( nextProps ) {
39
- if ( nextProps . children === this . props . children ) return ;
40
- this . setState ( { hasOverflowingChildren : false } ) ;
39
+ static getDerivedStateFromProps ( props , state ) {
40
+ if ( props . children === state . prevPropsChildren ) return null ;
41
+ return {
42
+ hasOverflowingChildren : false ,
43
+ prevPropsChildren : props . children ,
44
+ } ;
41
45
}
42
46
43
47
render ( ) {
You can’t perform that action at this time.
0 commit comments