React.lazy: Named Exports

// ManyComponents.js
export const MyComponent = /* ... */;
export const MyUnusedComponent = /* ... */;

// MyComponent.js
export { MyComponent as default } from "./ManyComponents.js";

// MyApp.js
import React, { lazy } from 'react';
const MyComponent = lazy(() => import("./MyComponent.js"));

If the module you want to import uses named exports, you can create an intermediate module that reexports it as the default.

React.lazy: Named Exports — Structure map

Clickable & Draggable!

React.lazy: Named Exports — Related pages: