Replies: 1 comment 3 replies
-
very easy to do: https://codesandbox.io/s/romantic-tharp-0buje simply switch the canvas to concurrent. now everything you put into suspense will execute once everything in there has resolved: <Canvas concurrent>
<Suspense fallback={null}>
<Model />
<MoveCamera /> it sucks that this doesnt work without a concurrent react root, i think they either made a mistake or couldn't quite solve it. in legacy react each thing in suspense renders immediately when its resolved. thankfully concurrent react will become the default or the norm. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am new to React.js and declarative programming so this is somewhat confusing to me. I managed to load a model and render it with the code below. Now I would like to recalculate the three.js camera position once after the loading is complete. I know I can get the camera from
useThree
oruseFrame
, but then those are called after canvas resizes or for every frame. I thought ofuseEffect
after I load the asset, but then how do I get the camera in there?Beta Was this translation helpful? Give feedback.
All reactions