DEV Community

Discussion on: 10 React Practices To Make Your Code Better.

Collapse
 
tbroyer profile image
Info Comment hidden by post author - thread only visible in this permalink
Thomas Broyer • Edited

With lazy-loaded components there is no escape, you need to export default them.

That's not true:

const Foo = lazy(async () => {
  const { Foo } = await import("./Foo.js");
  return Foo;
});
Enter fullscreen mode Exit fullscreen mode

Some comments have been hidden by the post's author - find out more