@@ -63,15 +63,21 @@ export function noSSR<P = {}>(
63
63
delete loadableOptions . modules
64
64
65
65
// This check is necessary to prevent react-loadable from initializing on the server
66
+ console . log ( 'isServerSide' , isServerSide )
66
67
if ( ! isServerSide ) {
67
68
return LoadableInitializer ( loadableOptions )
68
69
}
69
70
70
71
const Loading = loadableOptions . loading !
72
+ console . log ( 'Loading: ' , Loading )
71
73
// This will only be rendered on the server side
72
- return ( ) => (
73
- < Loading error = { null } isLoading pastDelay = { false } timedOut = { false } />
74
- )
74
+ return ( ) => {
75
+ const el = (
76
+ < Loading error = { null } isLoading pastDelay = { false } timedOut = { false } />
77
+ )
78
+ console . log ( 'el:' , el )
79
+ return el
80
+ }
75
81
}
76
82
77
83
export default function dynamic < P = { } > (
@@ -83,6 +89,7 @@ export default function dynamic<P = {}>(
83
89
let loadableOptions : LoadableOptions < P > = {
84
90
// A loading component is not required, so we default it
85
91
loading : ( { error, isLoading, pastDelay } ) => {
92
+ console . log ( `Render loading: ` , { error, isLoading, pastDelay } )
86
93
if ( ! pastDelay ) return null
87
94
if ( process . env . NODE_ENV !== 'production' ) {
88
95
if ( isLoading ) {
@@ -120,11 +127,12 @@ export default function dynamic<P = {}>(
120
127
loadableOptions = { ...loadableOptions , ...options }
121
128
122
129
const loaderFn = loadableOptions . loader as ( ) => LoaderComponent < P >
123
- const loader = ( ) =>
124
- loaderFn != null
130
+ const loader = ( ) => {
131
+ console . log ( `loader called` )
132
+ return loaderFn != null
125
133
? loaderFn ( ) . then ( convertModule )
126
134
: Promise . resolve ( convertModule ( ( ) => null ) )
127
-
135
+ }
128
136
// coming from build/babel/plugins/react-loadable-plugin.js
129
137
if ( loadableOptions . loadableGenerated ) {
130
138
loadableOptions = {
@@ -134,6 +142,7 @@ export default function dynamic<P = {}>(
134
142
delete loadableOptions . loadableGenerated
135
143
}
136
144
145
+ console . log ( 'LoadableOptions' , loadableOptions )
137
146
// support for disabling server side rendering, eg: dynamic(() => import('../hello-world'), {ssr: false}).
138
147
if ( typeof loadableOptions . ssr === 'boolean' && ! loadableOptions . ssr ) {
139
148
delete loadableOptions . webpack
0 commit comments