Skip to content

GPU not utilized when using React 19 StrictMode (works fine when StrictMode is removed) #3598

@Houss-L

Description

@Houss-L

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

  1. Clone or open this minimal demo:
    👉 https://stackblitz.com/edit/vitejs-vite-nlkcutn6

  2. Run the project — observe the r3f-perf panel (GPU = 0%).

  3. Open main.jsx and remove <React.StrictMode>.

  4. 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions