Skip to content

Commit efd9253

Browse files
committed
fix(three): stop using r3f's render loop
FrameLoop is incompatible with r3f's render loop, because of how the FrameLoop calls r3f's `invalidate` function inside r3f's global effects queue. In doing that, the `invalidate` call is ignored, and the frameloop is effectively paused.
1 parent ae8fecd commit efd9253

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

targets/three/src/index.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
import { invalidate, applyProps, addEffect } from 'react-three-fiber'
2-
import { Globals, FrameLoop, update } from 'core'
1+
import { applyProps, addEffect } from 'react-three-fiber'
2+
import { Globals, FrameLoop } from 'core'
33
import { createStringInterpolator } from 'shared/stringInterpolation'
44
import colorNames from 'shared/colors'
55

6-
// Add the update function as a global effect to react-three-fibers update loop
7-
if (addEffect) addEffect(update)
8-
96
Globals.assign({
107
defaultElement: 'group',
11-
frameLoop: addEffect && new FrameLoop(invalidate),
8+
frameLoop: addEffect && new FrameLoop(),
129
applyAnimatedValues: applyProps,
1310
createStringInterpolator,
1411
colorNames,

0 commit comments

Comments
 (0)