Skip to content

Commit 9ec0666

Browse files
committed
break up import keyword to avoid being accidentally parsed as dynamic import statement in external code
1 parent 3f62dec commit 9ec0666

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react/src/ReactLazy.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ function lazyInitializer<T>(payload: Payload<T>): T {
8888
if (__DEV__) {
8989
if (moduleObject === undefined) {
9090
console.error(
91-
'lazy: Expected the result of a dynamic import() call. ' +
91+
'lazy: Expected the result of a dynamic imp' +
92+
'ort() call. ' +
9293
'Instead received: %s\n\nYour code should look like: \n ' +
9394
// Break up imports to avoid accidentally parsing them as dependencies.
9495
'const MyComponent = lazy(() => imp' +
@@ -101,7 +102,8 @@ function lazyInitializer<T>(payload: Payload<T>): T {
101102
if (__DEV__) {
102103
if (!('default' in moduleObject)) {
103104
console.error(
104-
'lazy: Expected the result of a dynamic import() call. ' +
105+
'lazy: Expected the result of a dynamic imp' +
106+
'ort() call. ' +
105107
'Instead received: %s\n\nYour code should look like: \n ' +
106108
// Break up imports to avoid accidentally parsing them as dependencies.
107109
'const MyComponent = lazy(() => imp' +

0 commit comments

Comments
 (0)