Back to rules
RuleSource Checked

Keep per-frame values out of React state

Use refs and the render loop for values that change every frame.

Checked July 10, 2026

Ready to use

Rule text

1 line
In React Three Fiber, do not call React state setters for per-frame transforms or other rapidly changing values. Mutate object refs inside useFrame and reserve React state for application state that should cause a render.

Why it helps

The reasoning behind the entry

Rendering the React tree for frame-level values creates unnecessary work and can make motion feel uneven.

Filed under

Use it in more than one place

Platform
Web