-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
When running an R3F scene under React 19’s StrictMode, the GPU is not being used anymore — the rendering seems to fall back to CPU or stops using WebGL properly.
The issue can be clearly observed using r3f-perf: the GPU usage indicator drops to 0%, while CPU metrics remain active.
When StrictMode is removed, everything works perfectly — GPU usage returns to normal and the scene performs as expected.
Steps to Reproduce
-
Clone or open this minimal demo:
👉 https://stackblitz.com/edit/vitejs-vite-nlkcutn6 -
Run the project — observe the
r3f-perfpanel (GPU = 0%). -
Open
main.jsxand remove<React.StrictMode>. -
Reload — GPU usage works correctly again.
Expected Behavior
R3F should still use GPU rendering normally even when running under React 19’s StrictMode.
Actual Behavior
When StrictMode is enabled:
-
GPU usage stays at 0%.
-
Removing StrictMode immediately restores proper GPU rendering.
-> This issue does **not occur with React 18** — GPU usage works normally under StrictMode in React 18. The problem only appears after upgrading to React 19, suggesting a potential change in how React 19’s StrictMode interacts with WebGL or side effects during renderer initialization.
Environment
| Package | Version |
|---|---|
| React | 19.2.0 |
| React DOM | 19.2.0 |
| @react-three/fiber | 9.4.0 |
| @react-three/drei | 10.7.7 |
| three | 0.181.1 |
| r3f-perf | 7.2.3 |
| Browser | Chrome / Edge (latest) |
| Platform | Windows 11 / macOS (tested) |