File tree 1 file changed +14
-5
lines changed
1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,18 @@ function resolveConstructor(ctor) {
26
26
return ctor
27
27
}
28
28
29
- const withChunkExtractor = Component => props => (
30
- < Context . Consumer >
31
- { extractor => < Component __chunkExtractor = { extractor } { ...props } /> }
32
- </ Context . Consumer >
33
- )
29
+ const withChunkExtractor = Component => {
30
+ const LoadableWithChunkExtractor = props => (
31
+ < Context . Consumer >
32
+ { extractor => < Component __chunkExtractor = { extractor } { ...props } /> }
33
+ </ Context . Consumer >
34
+ )
35
+ if ( Component . displayName ) {
36
+ LoadableWithChunkExtractor . displayName =
37
+ `${ Component . displayName } WithChunkExtractor` ;
38
+ }
39
+ return LoadableWithChunkExtractor
40
+ }
34
41
35
42
const identity = v => v
36
43
@@ -332,6 +339,8 @@ function createLoadable({
332
339
< EnhancedInnerLoadable forwardedRef = { ref } { ...props } />
333
340
) )
334
341
342
+ Loadable . displayName = 'Loadable'
343
+
335
344
// In future, preload could use `<link rel="preload">`
336
345
Loadable . preload = props => {
337
346
ctor . requireAsync ( props )
You can’t perform that action at this time.
0 commit comments