File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -77,29 +77,26 @@ class LazilyLoad extends React.Component {
77
77
};
78
78
}
79
79
80
- componentWillMount () {
81
- this .load (this .props );
82
- }
83
-
84
80
componentDidMount () {
85
81
this ._isMounted = true ;
82
+ this .load ();
86
83
}
87
84
88
- componentWillReceiveProps ( next ) {
89
- if (next . modules === this . props .modules ) return null ;
90
- this .load (next );
85
+ componentDidUpdate ( previous ) {
86
+ if (this . props . modules === previous .modules ) return null ;
87
+ this .load ();
91
88
}
92
89
93
90
componentWillUnmount () {
94
91
this ._isMounted = false ;
95
92
}
96
93
97
- load (props ) {
94
+ load () {
98
95
this .setState ({
99
96
isLoaded: false ,
100
97
});
101
98
102
- const { modules } = props;
99
+ const { modules } = this . props ;
103
100
const keys = Object .keys (modules);
104
101
105
102
Promise .all (keys .map ((key ) => modules[key]()))
You can’t perform that action at this time.
0 commit comments