Is it possible to load a heavy module using React.lazy
?
I have a very heavy raw file parsed as string (around 10 mb) and I would like to lazy load it.
After trying:
const Module = React.lazy(() =>
import("./heavyModule").then((heavyModule) => {
return (
<Suspense fallback={null}>
<SomeComponent src={heavyModule.value} />
</Suspense>
);
})
);
Im getting the following error:
lazy: Expected the result of a dynamic $csbImport() call. Instead received: [object Object]