Skip to content

Commit

Permalink
fix: correctly pass frames in invalidate (#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
krispya committed Mar 21, 2024
1 parent 4689d0e commit 0b82cdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/fiber/src/core/loop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function loop(timestamp: number): void {
* @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
*/
export function invalidate(state?: RootState, frames = 1): void {
if (!state) return _roots.forEach((root) => invalidate(root.store.getState()), frames)
if (!state) return _roots.forEach((root) => invalidate(root.store.getState(), frames))
if (state.gl.xr?.isPresenting || !state.internal.active || state.frameloop === 'never') return
// Increase frames, do not go higher than 60
state.internal.frames = Math.min(60, state.internal.frames + frames)
Expand Down

0 comments on commit 0b82cdd

Please sign in to comment.