@@ -32,6 +32,10 @@ export default class NetPyNEConnectivityRule extends React.Component {
32
32
} ;
33
33
}
34
34
35
+ UNSAFE_componentWillReceiveProps ( nextProps ) {
36
+ this . setState ( { currentName : nextProps . name } ) ;
37
+ }
38
+
35
39
handleRenameChange = ( event ) => {
36
40
const storedValue = this . props . name ;
37
41
const newValue = Utils . nameValidation ( event . target . value ) ;
@@ -60,19 +64,7 @@ export default class NetPyNEConnectivityRule extends React.Component {
60
64
}
61
65
} ;
62
66
63
- triggerUpdate ( updateMethod ) {
64
- // common strategy when triggering processing of a value change, delay it, every time there is a change we reset
65
- // eslint-disable-next-line eqeqeq
66
- if ( this . updateTimer !== undefined ) {
67
- clearTimeout ( this . updateTimer ) ;
68
- }
69
- this . updateTimer = setTimeout ( updateMethod , 1000 ) ;
70
- }
71
-
72
- select = ( index , sectionId ) => this . setState ( {
73
- selectedIndex : index ,
74
- sectionId,
75
- } ) ;
67
+ handleChange = ( event , index , values ) => this . setState ( { values } ) ;
76
68
77
69
getBottomNavigationAction ( index , sectionId , label , icon , id ) {
78
70
return (
@@ -86,6 +78,20 @@ export default class NetPyNEConnectivityRule extends React.Component {
86
78
) ;
87
79
}
88
80
81
+ select = ( index , sectionId ) => this . setState ( {
82
+ selectedIndex : index ,
83
+ sectionId,
84
+ } ) ;
85
+
86
+ triggerUpdate ( updateMethod ) {
87
+ // common strategy when triggering processing of a value change, delay it, every time there is a change we reset
88
+ // eslint-disable-next-line eqeqeq
89
+ if ( this . updateTimer !== undefined ) {
90
+ clearTimeout ( this . updateTimer ) ;
91
+ }
92
+ this . updateTimer = setTimeout ( updateMethod , 1000 ) ;
93
+ }
94
+
89
95
postProcessMenuItems ( pythonData , selected ) {
90
96
return pythonData . map ( ( name ) => (
91
97
< MenuItem
@@ -99,10 +105,6 @@ export default class NetPyNEConnectivityRule extends React.Component {
99
105
) ) ;
100
106
}
101
107
102
- UNSAFE_componentWillReceiveProps ( nextProps ) {
103
- this . setState ( { currentName : nextProps . name } ) ;
104
- }
105
-
106
108
render ( ) {
107
109
const dialogPop = this . state . errorMessage !== undefined ? (
108
110
< Dialog open style = { { whiteSpace : 'pre-wrap' } } >
@@ -445,6 +447,4 @@ export default class NetPyNEConnectivityRule extends React.Component {
445
447
</ div >
446
448
) ;
447
449
}
448
-
449
- handleChange = ( event , index , values ) => this . setState ( { values } ) ;
450
450
}
0 commit comments