File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React from 'react'
3
3
let currentChunks = [ ]
4
4
5
5
export default function dynamicComponent ( promise , options = { } ) {
6
- return class Comp extends React . Component {
6
+ return class DynamicComponent extends React . Component {
7
7
constructor ( ...args ) {
8
8
super ( ...args )
9
9
@@ -20,6 +20,12 @@ export default function dynamicComponent (promise, options = {}) {
20
20
21
21
loadComponent ( ) {
22
22
promise . then ( ( AsyncComponent ) => {
23
+ // Set a readable displayName for the wrapper component
24
+ const ayncCompName = AsyncComponent . displayName || AsyncComponent . name
25
+ if ( ayncCompName ) {
26
+ DynamicComponent . displayName = `DynamicComponent for ${ ayncCompName } `
27
+ }
28
+
23
29
if ( this . mounted ) {
24
30
this . setState ( { AsyncComponent } )
25
31
} else {
You can’t perform that action at this time.
0 commit comments