Open utterances-bot opened 1 year ago
Great article Felix, thanks a lot for sharing. Just 2 little remarks: -In step 1, isn't the correct syntax: export { default as MyComponent } instead of export { MyComponent as default }... -In the first line of the Error Handling section you wrote: "It an happen that...", so just a little typo
Thanks, @RubenGarciaBri! I updated the article to fix these typos
There's one more way to use named exports with React.lazy:
const LazyComponent = lazy(
() => import('./components)
.then(module => ({ default: module.Component }))
);
thanks bro
Lazy loading React components with React.lazy | Felix Gerschau
Learn how to improve performance by reducing the bundle size of your application.
https://felixgerschau.com/react-lazy-loading-components/