v10 deployment.v10 Breaking Changes
Everything that can break an app or library moving from @react-three/fiber v9 to v10, in one
list. Each entry says what to do; the migration guide has the detail and
examples, and CHANGELOG-ALPHA.md
has the history per alpha.
Many of these throw an error that names the fix. The ones marked silent change behaviour or types without an error, so check for them.
@react-three/eslint-plugin's migration config finds most of these in your code and fixes many
of them with --fix: the gl and clock reads, numeric useFrame priorities, removed Canvas
props and imports, onUpdate and <color attach="background">. Add configs.migration to your
eslint.config.js (eslintrc: plugin:@react-three/legacy-migration) while you upgrade; see the
plugin readme.
Renderer and entries
Dependencies
Canvas props
Frame loop
Assets and textures
TypeScript and testing
Upgrading from an earlier v10 alpha
On top of the above, alpha users also meet these changes to APIs that only existed in the alphas:
- TSL hooks moved to
@react-three/tsl(useUniforms,useUniform,useNodes,useLocalNodes,useBuffers,useGPUStorage,useRenderPipeline,rebuildAll*); the standalone utilities (removeUniforms(set, …),clearScope,clearRootUniforms,removeNodes(set, …),clearNodeScope,clearRootNodes) are removed. alpha.6 useRenderPipelinebelongs to the component that configures it. Unmounting that component frees the pipeline and its scene pass, and the canvas renders without post-processing again. Pass{ persist: true }as the third argument to keep it rendering after unmount. A call without callbacks only reads and no longer creates a pipeline. alpha.6- Unregistered TSL reads are typed
LooseUniformNode/LooseNode, so they work in TSL without casts. Writing a concrete node straight intostate.uniformsorstate.nodeswithsetState(instead of through the hooks) now needs a cast. alpha.6 useLocalNodeswith no dependency array re-runs every render; pass[]for the old memoised behaviour. alpha.6- Multi-canvas is configured on the Canvas.
renderer={{ primaryCanvas }}andrenderer={{ scheduler }}throw: use<Canvas primary>,share, and<Canvas scheduler>. alpha.6 <Canvas renderer>is the same as<Canvas>on@react-three/fiber; a plain<Canvas>that was on WebGL is now on WebGPU. alpha.6usePostProcessing→useRenderPipeline, andstate.postProcessing→state.renderPipeline. alpha.3RenderTargetCompat→R3FRenderTarget,ThreeElementsImpl→ThreeElementsOf<T>, and no entry callsextend(THREE)at import time. alpha.6