Closed
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
Named components that have been extracted in a .then()
call are not being recognized.
const NamedExport = React.lazy(() =>
import("./NamedExport")
.then(module => module.NamedExport)
.then(component => {
console.log(component)
return component
})
)
The code above is generating the error below despite the fact that the named export gets logged to the console correctly.
Invariant Violation
Element type is invalid. Received a promise that resolves to: undefined. Promise elements must resolve to a class or function.
What is the expected behavior?
This should render the component correctly
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
react 16.6.0
react-dom 16.6.0
MacOS 10.14 Version 69.0.3497.100
React.lazy was not in previous versions of React
Metadata
Metadata
Assignees
Labels
No labels