Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 19, 2025

This PR contains the following updates:

Package Change Age Confidence
@react-three/fiber ^8.18.0^9.5.0 age confidence

Release Notes

pmndrs/react-three-fiber (@​react-three/fiber)

v9.5.0

Compare Source

After a bit of research and development, R3F is now compatible with React 19.2, including the Activity feature!

Why did this take some effort, you might wonder? When React bumped to version 19.2.x, they also bumped the internal reconciler up a version which was not backwards compatible with 19.1.x. This put us in an awkward position of either making a breaking change in the middle of R3F v9, bump to another major just because of an internal detail from React or get creative. We chose to get creative and R3F is compatible with all versions of React between 19.0 and 19.2. The downside is we had to bundle the reconciler with R3F, but react-dom already does this so for now it is the best solution available.

Forcing breaking changes on libraries is likely not what the React teams intended so we will be working with them to try to avoid this in the future.

Happy coding.

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.4.2...v9.5.0

v9.4.2

Compare Source

What's Changed

New Contributors

Full Changelog: pmndrs/react-three-fiber@v9.4.1...v9.4.2

v9.4.1

Compare Source

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.4.0...v9.4.1

v9.4.0

Compare Source

What's Changed
New Contributors

Full Changelog: pmndrs/react-three-fiber@v9.3.0...v9.4.0

v9.3.0

Compare Source

With this release we have two big fixes.

  1. flushSync now works properly. To prove it we added an example that allows you to React props and then take a screenshot of the R3F canvas with the latest state. This is a pretty advanced use case, but one people might be interested to explore for exporting videos or images using R3F.
  2. React Native support has been fixed for 0.79 and newer when combined with the same update to Drei: pmndrs/drei#2494. A big thanks to @​thejustinwalsh for helping us with this one.

What's Changed

New Contributors

Full Changelog: pmndrs/react-three-fiber@v9.1.4...v9.3.0

v9.2.0

Compare Source

v9.1.4

Compare Source

What's Changed
New Contributors

Full Changelog: pmndrs/react-three-fiber@v9.1.3...v9.1.4

v9.1.3

Compare Source

What's Changed

New Contributors

Full Changelog: pmndrs/react-three-fiber@v9.1.2...v9.1.3

v9.1.2

Compare Source

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.1.1...v9.1.2

v9.1.1

Compare Source

Most importantly, this fixes rsbuild with vReact 19.1.0 and later.

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.1.0...v9.1.1

v9.1.0

Compare Source

What's Changed

New Contributors

Full Changelog: pmndrs/react-three-fiber@v9.0.4...v9.1.0

v9.0.4

Compare Source

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.0.3...v9.0.4

v9.0.3

Compare Source

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.0.2...v9.0.3

v9.0.2

Compare Source

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.0.1...v9.0.2

v9.0.1

Compare Source

What's Changed

Full Changelog: pmndrs/react-three-fiber@v9.0.0...v9.0.1

v9.0.0

Compare Source

This is a compatibility release for React 19, which brings further performance, stability, and type improvements. You can check out the React 19 changelog here.

We would like to express our gratitude to the community for their continued support, as well as to all our contributors, including the React team at Meta and Vercel, for ensuring this upgrade went smoothly. 🎉

[!WARNING]
This release contains breaking changes when using Strict Mode, which can highlight bugs during development. See StrictMode.

Features

useLoader Accepts Loader Instance

useLoader now supports re-use of external loader instances for more controlled pooling and setup.

import { GLTFLoader } from 'three/addons'
import { useLoader } from '@​react-three/fiber'

function Model() {
  const gltf = useLoader(GLTFLoader, '/path/to/model.glb')
  // ...
}

// or,

const loader = new GLTFLoader()
function Model() {
  const gltf = useLoader(loader, '/path/to/model.glb')
  // ...
}
Factory extend Signature

extend can now produce a component when a three.js class is passed to it individually instead of a catalog of named classes. This is backwards compatible and reduces TypeScript boilerplate and JSX collisions. We recommend libraries migrate to this signature so internal components don't clash with user-land declarations.

import { OrbitControls } from 'three/addons'
import { type ThreeElement, type ThreeElements } from '@​react-three/fiber'

declare module '@​react-three/fiber' {
  interface ThreeElements {
    orbitControls: ThreeElement<typeof OrbitControls>
  }
}

extend({ OrbitControls })

<orbitControls args={[camera, gl.domElement]}>

// or,

const Controls = extend(OrbitControls)
<Controls args={[camera, gl.domElement]} />
Async GL prop

The Canvas GL prop accepts constructor parameters, properties, or a renderer instance via a callback. The callback now passes constructor parameters instead of just a canvas reference.

<Canvas
  gl={{ reverseDepthBuffer: true }}
- gl={(canvas) => new WebGLRenderer({ canvas })}
+ gl={(props) => new WebGLRenderer(props)}
>

Further, a callback passed to GL can now return a promise for async constructors like WebGPURenderer (see WebGPU).

<Canvas
  gl={async (props) => {
    // ...
    return renderer
  }}
>

WebGPU

Recent Three.js now includes a WebGPU renderer. While still a work in progress and not fully backward-compatible with all of Three's features, the renderer requires an async initialization method. R3F streamlines this by allowing the gl prop to return a promise.

import * as THREE from 'three/webgpu'
import * as TSL from 'three/tsl'
import { Canvas, extend, useFrame, useThree } from '@&#8203;react-three/fiber'

declare module '@&#8203;react-three/fiber' {
  interface ThreeElements extends ThreeToJSXElements<typeof THREE> {}
}

extend(THREE as any)

export default () => (
  <Canvas
    gl={async (props) => {
      const renderer = new THREE.WebGPURenderer(props as any)
      await renderer.init()
      return renderer
    }}>
      <mesh>
        <meshBasicNodeMaterial />
        <boxGeometry />
      </mesh>
  </Canvas>
)

Fixes

Color Management of Textures

Automatic sRGB conversion of texture props has been removed. Color textures are now handled automatically for built-in materials, aligning with vanilla Three.js behavior. This prevents issues where data textures (e.g., normals or displacement) become corrupted or non-linear. For custom materials or shaders, annotate color textures with texture.colorSpace = THREE.SRGBColorSpace or texture-colorSpace={THREE.SRGBColorSpace} in JSX.

For more details, see https://threejs.org/docs/#manual/en/introduction/Color-management.

Suspense and Side-Effects

The handling of Suspense and fallback content has improved in React and R3F. Side-effects like attach and constructor effects (e.g., controls adding event listeners) no longer fire repeatedly without proper cleanup during suspension.

import { ThreeElement, useThree } from '@&#8203;react-three/fiber'
import { OrbitControls } from 'three/addons'

declare module '@&#8203;react-three/fiber' {
  interface ThreeElements {
    OrbitControls: ThreeElement<typeof OrbitControls>
  }
}

extend({ OrbitControls })

function Controls() {
  const camera = useThree((state) => state.camera)
  const gl = useThree((state) => state.gl)

  // Will only initialize when tree is connected to screen
  return <orbitControls args={[camera, gl.domElement]}>
}

<Suspense>
  <Controls />
  <AsyncComponent />
</Suspense>
Swapping with args and primitives

Swapping elements when changing the args or primitive object prop has been improved for structured children like arrays or iterators (React supports both, including async iterators). Previously, primitives sharing an object could update out of order or be removed from the scene along with their children.

See: #​3272

TypeScript Changes

Props renamed to CanvasProps

Canvas Props is now called CanvasProps for clarity. These were aliased in v8 for forward compatibility, but Props is removed with v9.

-function Canvas(props: Props)
+function Canvas(props: CanvasProps)
Dynamic JSX Types

Since R3F's creation, JSX types had to be maintained in accordance with additions to three core API. Although missing or future types could be ignored or resilient for forward and backwards compatibility, this was a major maintenance burden for us and those extending three. Furthermore, libraries which wrap or bind to the known catalog of elements (e.g. React Spring <animated.mesh />) had no way of knowing which elements belonged to a renderer.

Since v8, we've added a catalog of known elements to a ThreeElements interface, and with v9 automatically map three API to JSX types. As types are now dynamically mapped, hardcoded exports like MeshProps have been removed, and can be accessed as ThreeElements['mesh']. Helper types like Color or Vector3 remain to reflect the JSX MathType API for shorthand expression.

-import { MeshProps } from '@&#8203;react-three/fiber'
-type Props = MeshProps

+import { ThreeElements } from '@&#8203;react-three/fiber'
+type Props = ThreeElements['mesh']
Node Helpers

Specialized Node type helpers for extending JSX (Node, Object3DNode, BufferGeometryNode, MaterialNode, LightNode) are removed and combined into 'ThreeElement', which accepts a single type representing the extended element instance.

import { type ThreeElement } from '@&#8203;react-three/fiber'

declare module '@&#8203;react-three/fiber' {
  interface ThreeElements {
    customElement: ThreeElement<typeof CustomElement>
  }
}

extend({ CustomElement })
ThreeElements

ThreeElements was added as an interface since v8.1.0 and is the current way of declaring or accessing JSX within R3F since React's depreciation of global JSX (see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript). All JSX types belonging to R3F are accessible from ThreeElements.

-import { type Node } from '@&#8203;react-three/fiber'
-
-declare global {
-  namespace JSX {
-    interface IntrinsicElements {
-      customElement: Node<CustomElement, typeof CustomElement>
-    }
-  }
-}
-
-extend({ CustomElement })

+import { type ThreeElement } from '@&#8203;react-three/fiber'
+
+declare module '@&#8203;react-three/fiber' {
+  interface ThreeElements {
+    customElement: ThreeElement<typeof CustomElement>
+  }
+}
+
+extend({ CustomElement })

Testing

StrictMode

StrictMode is now correctly inherited from a parent renderer like react-dom. Previously, <StrictMode /> mounted in another root such as react-dom would not affect the R3F canvas, so it had to be redeclared within the canvas as well.

<StrictMode>
  <Canvas>
-    <StrictMode>
-      // ...
-    </StrictMode>
+    // ...
  </Canvas>
</StrictMode>

Keep in mind, this change may affect the behavior of your application. If you encounter anything that worked before and fails now, profile it first in dev and then production. If it works in prod then strict mode has flushed out a side-effect in your code.

Act

act is now exported from React itself and can be used for all renderers. It will return the contents of a passed async callback like before and recursively flush async effects to synchronously test React output.

import { act } from 'react'
import { createRoot } from '@&#8203;react-three/fiber'

const store = await act(async () => createRoot(canvas).render(<App />))
console.log(store.getState())

Full Changelog: pmndrs/react-three-fiber@v8.18.0...v9.0.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from 54ef814 to 12b6038 Compare February 20, 2025 12:33
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from 5ff8b14 to 99ef770 Compare March 8, 2025 02:51
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from 7497fc8 to 3f10456 Compare March 24, 2025 23:04
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from e599ad7 to 3e33010 Compare April 6, 2025 10:02
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch from 3e33010 to fe38315 Compare May 6, 2025 17:34
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from cdbe957 to f44ec26 Compare May 27, 2025 20:52
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from 8a5cf07 to b8e71e2 Compare June 17, 2025 20:32
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from 09e4c6e to 1896923 Compare July 3, 2025 16:01
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch from 1896923 to 76f9bd7 Compare July 28, 2025 03:28
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch from 76f9bd7 to 73ce38d Compare August 10, 2025 13:13
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from c7ac489 to cb6f1b4 Compare August 22, 2025 22:56
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch from cb6f1b4 to ab208dc Compare August 31, 2025 13:26
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 7 times, most recently from eb067d1 to 0c4c268 Compare October 2, 2025 06:27
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch from 0c4c268 to 2023785 Compare October 3, 2025 02:32
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 3 times, most recently from 768a46a to a0fe1bf Compare November 7, 2025 17:05
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 6 times, most recently from ea10085 to 61e47d8 Compare November 15, 2025 08:59
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 6 times, most recently from 12ec2a5 to e573106 Compare November 24, 2025 21:44
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 2 times, most recently from 82300c7 to 4e3f56c Compare December 4, 2025 21:35
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 3 times, most recently from c1b189e to 4f632d1 Compare December 31, 2025 19:53
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 4 times, most recently from e2c4d9a to 6be8a75 Compare January 10, 2026 04:40
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch 4 times, most recently from ae3ab07 to a843bd0 Compare January 19, 2026 16:02
@renovate renovate bot force-pushed the renovate/react-three-fiber-9.x branch from a843bd0 to 41bac43 Compare January 29, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants