mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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>
This commit is contained in:
co-authored by
zhengjianhua
parent
6d6bba5bfc
commit
b8884de24e
@@ -88,7 +88,8 @@ function lazyInitializer<T>(payload: Payload<T>): T {
|
||||
if (__DEV__) {
|
||||
if (moduleObject === undefined) {
|
||||
console.error(
|
||||
'lazy: Expected the result of a dynamic import() call. ' +
|
||||
'lazy: Expected the result of a dynamic imp' +
|
||||
'ort() call. ' +
|
||||
'Instead received: %s\n\nYour code should look like: \n ' +
|
||||
// Break up imports to avoid accidentally parsing them as dependencies.
|
||||
'const MyComponent = lazy(() => imp' +
|
||||
@@ -101,7 +102,8 @@ function lazyInitializer<T>(payload: Payload<T>): T {
|
||||
if (__DEV__) {
|
||||
if (!('default' in moduleObject)) {
|
||||
console.error(
|
||||
'lazy: Expected the result of a dynamic import() call. ' +
|
||||
'lazy: Expected the result of a dynamic imp' +
|
||||
'ort() call. ' +
|
||||
'Instead received: %s\n\nYour code should look like: \n ' +
|
||||
// Break up imports to avoid accidentally parsing them as dependencies.
|
||||
'const MyComponent = lazy(() => imp' +
|
||||
|
||||
Reference in New Issue
Block a user