@@ -57,11 +57,10 @@ function asyncComponent(config) {
57
57
error : null ,
58
58
// Allows us to share the resolver promise across instances.
59
59
resolver : null
60
- } ;
61
60
62
- // Takes the given module and if it has a ".default" the ".default" will
63
- // be returned. i.e. handy when you could be dealing with es6 imports.
64
- var es6Resolve = function es6Resolve ( x ) {
61
+ // Takes the given module and if it has a ".default" the ".default" will
62
+ // be returned. i.e. handy when you could be dealing with es6 imports.
63
+ } ; var es6Resolve = function es6Resolve ( x ) {
65
64
return autoResolveES2015Default && x != null && ( typeof x === 'function' || ( typeof x === 'undefined' ? 'undefined' : _typeof ( x ) ) === 'object' ) && x . default ? x . default : x ;
66
65
} ;
67
66
@@ -141,7 +140,9 @@ function asyncComponent(config) {
141
140
} , {
142
141
key : 'componentWillMount' ,
143
142
value : function componentWillMount ( ) {
144
- this . setState ( { module : sharedState . module } ) ;
143
+ this . setState ( {
144
+ module : sharedState . module
145
+ } ) ;
145
146
if ( sharedState . error ) {
146
147
this . registerErrorState ( sharedState . error ) ;
147
148
}
@@ -169,7 +170,9 @@ function asyncComponent(config) {
169
170
}
170
171
sharedState . module = module ;
171
172
if ( env === 'browser' ) {
172
- _this3 . setState ( { module : module } ) ;
173
+ _this3 . setState ( {
174
+ module : module
175
+ } ) ;
173
176
}
174
177
_this3 . resolving = false ;
175
178
return module ;
@@ -204,7 +207,9 @@ function asyncComponent(config) {
204
207
if ( env === 'browser' ) {
205
208
setTimeout ( function ( ) {
206
209
if ( ! _this4 . unmounted ) {
207
- _this4 . setState ( { error : error } ) ;
210
+ _this4 . setState ( {
211
+ error : error
212
+ } ) ;
208
213
}
209
214
} , 16 ) ;
210
215
}
@@ -230,7 +235,6 @@ function asyncComponent(config) {
230
235
}
231
236
232
237
var Component = es6Resolve ( module ) ;
233
- // eslint-disable-next-line no-nested-ternary
234
238
return Component ? _react2 . default . createElement ( Component , this . props ) : LoadingComponent ? _react2 . default . createElement ( LoadingComponent , this . props ) : null ;
235
239
}
236
240
} ] ) ;
@@ -239,6 +243,7 @@ function asyncComponent(config) {
239
243
} ( _react2 . default . Component ) ;
240
244
241
245
AsyncComponent . displayName = name || 'AsyncComponent' ;
246
+
242
247
AsyncComponent . contextTypes = {
243
248
asyncComponentsAncestor : _propTypes2 . default . shape ( {
244
249
isBoundary : _propTypes2 . default . bool
@@ -249,13 +254,13 @@ function asyncComponent(config) {
249
254
shouldRehydrate : _propTypes2 . default . func . isRequired
250
255
} )
251
256
} ;
257
+
252
258
AsyncComponent . childContextTypes = {
253
259
asyncComponentsAncestor : _propTypes2 . default . shape ( {
254
260
isBoundary : _propTypes2 . default . bool
255
261
} )
256
262
} ;
257
263
258
-
259
264
return AsyncComponent ;
260
265
}
261
266
0 commit comments