'React.Suspense doesn't take a non null fallback, used for a React Three Fiber model
If I set a non-null fallback to React.Suspense, the screen goes white, but if I let it as null, nothing bad happens
This code goes white (when it finishes loading the model):
Component ShowModel.js:
const LazyModel = React.lazy(() => import("./Model"))
return (
<Canvas
style={{
width: "100%",
height: "100%",
backgroundColor: "black",
}}
>
<ambientLight intensity={0.4} />
<directionalLight
intensity={2}
color="white"
position={[0, 2, 4]}
/>
<Suspense fallback={<h1>Still Loading…</h1>}>
<LazyModel />
</Suspense>
</Canvas>
)
But if I set
<Suspense fallback={null}>
nothing bad happens
I also tried with @loadable/component, but it went white also
What could it be?
Thanks in advance
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
