Comparison
Dynamic importvsLazy component
Dynamic import
you wrote `await import('./editor')` and the bundler quietly turned that line into a separate file.
The function-like `import()` form that returns a promise and is the mechanism every code split is built on. Because it is a syntactic marker, the bundler creates a chunk at that point whether or not you thought of it as a split. It returns the module namespace, so the default export arrives as `.default`, which is the source of the classic 'component is not a function' error.
Full entry →Lazy component
the chart component loads on first render of the chart, with a fallback shown while it arrives.
A component declared as a dynamic import so its code is fetched at first use, paired with a loading fallback. It is code splitting made ergonomic, and it is the right default for anything heavy and conditional — editors, charts, maps, modals. Two things bite: a network failure now happens mid-interaction and needs an error boundary, and lazy-loading something above the fold trades bundle size for a visible delay.
Full entry →