github pmndrs/react-three-fiber v10.0.0-beta.1
v10 Beta 1

pre-release42 minutes ago

The first beta. Install with npm install @react-three/fiber@beta.

Breaking Changes
@react-three/fiber/webgpu and @react-three/test-renderer/webgpu are removed, as announced when they were deprecated in alpha.6. Importing either now fails to resolve. Import from @react-three/fiber and @react-three/test-renderer, which render with WebGPU; the eslint plugin's no-removed-imports rule rewrites the imports with --fix. The names only /webgpu exported change with it: its RootState (the WebGPU-narrowed state) is WebGPURootState on the root entry, where RootState is the base state that /webgpu called BaseRootState (likewise InternalState / WebGPUInternalState and R3FRenderer / WebGPUR3FRenderer); WebGPUCanvasProps is CanvasProps; the deprecated TextureEntry / TextureNode aliases are gone (the registry stores Texture), and createTextureOperations is no longer exported (use useTextures()). @react-three/test-renderer/webgpu's useTextures re-export is gone: import it from @react-three/fiber. See Renderer Selection.
Features
@react-three/test-renderer exports mockWebGPU and unmockWebGPU from its default entry (they were only on the removed /webgpu entry).
Bug Fixes
The last to unmount is released. The frame scheduler kept an unregistered root in its cached run order until the next frame, and with no root left the loop stopped, so the root and everything its state referenced stayed in memory until another canvas mounted. Fixed in @pmndrs/scheduler 0.3.1, now the minimum.
Canvas keeps an event target that someone else connected (drei's ScrollControls) when it re-renders, and reconnects only when its own target changes (#4047).
A reconstructed object (changed args, or a new object on a ) keeps its place among its siblings instead of moving to the end of its parent's children (#4035).
Unmounting a root commits once, flushing effect cleanups before the teardown instead of committing again, so React Refresh no longer keeps an unmounted root's scene and renderer in development; the teardown also completes under fake timers (#4058, #4054).
The per-pointer event state no longer grows by one entry per touch: a pointer that went up is dropped when another pointer goes down, after the click, contextmenu and dblclick that follow its release; a touch's hovers end then too, while a mouse or pen still hovering keeps its state.
useLoader names the URL when a loader's loadAsync rejects (Could not load : Failed to fetch), keeping the original error as cause and rethrowing an AbortError as is (#4064).
Reject mismatched URL and custom cache key counts in useLoader, preload, and clear.
onDoubleClick fires in Chrome: a dblclick has no pointerId, so it reads the pointer that last pressed or clicked instead of pointer 0, and its delta is measured from the real press (#4053).
Loading both the default and /legacy entry types no longer fails with TS2320 under skipLibCheck: false: bare is no longer an ambient JSX element, while ThreeElements['pMREMGenerator'] is unchanged (#4032).
onOccluded or onVisible added to an object that was already tracked (by onFramed, say) now fires on WebGPU when another object had already switched occlusion on. The handler update set occlusionTest only when it was the one enabling the system, and three never queries an object without it, so the new handler never heard of occlusion.
An object mounted out of view reports onFramed(false) / onVisible(false) from its first check. The check runs before render, where three refreshes world matrices, so a new object was tested at the origin and reported true, then false a frame later.
onFramed and onVisible work on a group, a light or any other object without geometry of its own, as the visibility docs promise. three's Frustum.intersectsObject throws for those, and it threw inside the per-frame visibility job, so no object on that root got visibility events at all. Such an object is now in view while the bounds of what it contains are, or while its position is when it contains no geometry. The bounds are measured once and cached, then measured again when a child or geometry is added, removed or replaced below it; a child that moves on its own is not seen, so assign the object a boundingSphere covering the motion.
with children films n frames. It filmed n - 1 for any n above 1 (so frames={2} filmed once), and the count lived in a render-scoped variable, so any re-render of the component started a finished environment filming again. The count now restarts only when what the environment films or how it is applied changes.
projects the texture without loading anything else. It also loaded files, which default to six cube faces (/px.png ...) the app never asked for, and threw wherever those were not served.
mounts the scene as soon as an async renderer is ready (every WebGPU canvas, and any async gl / renderer factory) instead of up to 300ms later: it no longer waits in a boundary, whose fallback react-dom throttles (#4063).
Examples
The repo's ESLint config runs the plugin's recommended and migration rules over example/src. legacy/SVGRenderer keeps , since three's SVGRenderer reads a plain color, and WebGPUMotionBlur keeps loading its model in an effect for its HMR cache; both say so in an eslint-disable comment. The WebGPU demos no longer describe the removed /webgpu entry.
eslint-plugin
no-removed-imports reports @react-three/fiber/webgpu and @react-three/test-renderer/webgpu as removed (message id webgpuRemoved, was webgpuDeprecated). The rules still recognize a Canvas imported from /webgpu, so code that has not migrated yet is checked as before.

Don't miss a new react-three-fiber release

NewReleases is sending notifications on new releases.