Я пытался создать LL C https://blog.logrocket.com/lazy-loading-components-in-react-16-6-6cea535c0b52/, но в итоге я получил ошибку:
Objects are not valid as a React child (found: object with keys {$$typeof, _ctor, _status, _result}). If you meant to render a collection of children, use an array instead.
<LazyLoadingComponent resolve={() => import('../StaticComponents/Notification/Notification')}>
</LazyLoadingComponent>
import React, { lazy, Suspense } from 'react';
function LazyLoadingComponent({ resolve }) {
console.log('resolve', resolve);
return (
<Suspense fallback={() => <h1>loading</h1>}>
{lazy(async () => {
const { default: module } = await resolve();
console.log(module, 'module');
return module;
})}
</Suspense>
);
}
export default LazyLoadingComponent;