Replies: 1 comment 5 replies
-
react-dom does not have a render-loop, only threejs needs that. r3f normally runs like a game 60fps, invalidateFrameloop stops that, so that it only renders when props change which is called rendering on demand. you can mix both the dom and r3f, of course you need to watch a little since if both perform expensive ops it can get narrow. there is a lot you can do to lessen the impact on both sides: invalidateFrameloop, instanced meshes, sharing materials & geometries, etc, and on the dom: virtual lists, concurrent mode, etc. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi I'm totally new to react and r3f, so please bear with my silly question!
I'm loading one gltf model around 40mb while extracting the scene graph and demonstrate with ant design's tree component that has around 12000 nodes as a HUD, and found that the node expansion starts to get laggy. However, with invalidateFrameloop props added to the canvas, the tree component can handle it perfectly. So my questions are:
I once read that canvas acts as a boundary to separate react-three-fiber's reconciler from the React default reconciler, does that mean that there are two render loop that are running "asynchronously" behind the scene (useFrame & react's lifecycle)?
Most samples i found on codesandbox are pure r3f and has no react components, so is there any best practice to avoid canvas affecting pure react component in my scenario? or is it normal for such file size?
App.js
View.js
ControlLoader.js
Beta Was this translation helpful? Give feedback.
All reactions