Skip to content

Commit b8884de

Browse files
authored
break up import keyword to avoid being accidentally parsed as dynamic import statement in external code (#21918)
Co-authored-by: zhengjianhua <zhengjianhua.michael@bytedance.com>
1 parent 6d6bba5 commit b8884de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/react/src/ReactLazy.js

+4-2
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)