@react-three/fiber 9.0.0-rc.2 → 9.0.0-rc.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,20 +31,21 @@ export declare function useFrame(callback: RenderCallback, renderPriority?: numb
31
31
  * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usegraph
32
32
  */
33
33
  export declare function useGraph(object: THREE.Object3D): ObjectMap;
34
- type LoaderInstance<T extends THREE.Loader<any> | ConstructorRepresentation<THREE.Loader<any>>> = T extends ConstructorRepresentation<THREE.Loader<any>> ? InstanceType<T> : T;
35
- export type LoaderResult<T extends THREE.Loader<any> | ConstructorRepresentation<THREE.Loader<any>>> = Awaited<ReturnType<LoaderInstance<T>['loadAsync']>> extends infer R ? R extends {
34
+ type LoaderLike = THREE.Loader<any, string | string[] | string[][] | Readonly<string | string[] | string[][]>>;
35
+ type LoaderInstance<T extends LoaderLike | ConstructorRepresentation<LoaderLike>> = T extends ConstructorRepresentation<LoaderLike> ? InstanceType<T> : T;
36
+ export type LoaderResult<T extends LoaderLike | ConstructorRepresentation<LoaderLike>> = Awaited<ReturnType<LoaderInstance<T>['loadAsync']>> extends infer R ? R extends {
36
37
  scene: THREE.Object3D;
37
38
  } ? R & ObjectMap : R : never;
38
- export type Extensions<T extends THREE.Loader<any> | ConstructorRepresentation<THREE.Loader<any>>> = (loader: LoaderInstance<T>) => void;
39
+ export type Extensions<T extends LoaderLike | ConstructorRepresentation<LoaderLike>> = (loader: LoaderInstance<T>) => void;
39
40
  /**
40
41
  * Synchronously loads and caches assets with a three loader.
41
42
  *
42
43
  * Note: this hook's caller must be wrapped with `React.Suspense`
43
44
  * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useloader
44
45
  */
45
- export declare function useLoader<T, U extends string | string[] | string[][], L extends THREE.Loader<any> | ConstructorRepresentation<THREE.Loader<any>>>(loader: L, input: U, extensions?: Extensions<L>, onProgress?: (event: ProgressEvent<EventTarget>) => void): U extends any[] ? LoaderResult<L>[] : LoaderResult<L>;
46
+ export declare function useLoader<T, U extends string | string[] | string[][], L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: U, extensions?: Extensions<L>, onProgress?: (event: ProgressEvent<EventTarget>) => void): U extends any[] ? LoaderResult<L>[] : LoaderResult<L>;
46
47
  export declare namespace useLoader {
47
- var preload: <T, U extends string | string[] | string[][], L extends THREE.Loader<any, string> | ConstructorRepresentation<THREE.Loader<any, string>>>(loader: L, input: U, extensions?: Extensions<L> | undefined) => void;
48
- var clear: <T, U extends string | string[] | string[][], L extends THREE.Loader<any, string> | ConstructorRepresentation<THREE.Loader<any, string>>>(loader: L, input: U) => void;
48
+ var preload: <T, U extends string | string[] | string[][], L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: U, extensions?: Extensions<L> | undefined) => void;
49
+ var clear: <T, U extends string | string[] | string[][], L extends LoaderLike | ConstructorRepresentation<LoaderLike>>(loader: L, input: U) => void;
49
50
  }
50
51
  export {};
@@ -4,11 +4,10 @@ import { RenderProps } from "../core/index.js";
4
4
  export interface CanvasProps extends Omit<RenderProps<HTMLCanvasElement>, 'size' | 'dpr'>, Omit<ViewProps, 'children'> {
5
5
  children: React.ReactNode;
6
6
  style?: ViewStyle;
7
- }
8
- export interface Props extends CanvasProps {
7
+ ref?: React.Ref<View>;
9
8
  }
10
9
  /**
11
10
  * A native canvas which accepts threejs elements as children.
12
11
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
13
12
  */
14
- export declare const Canvas: React.ForwardRefExoticComponent<CanvasProps & React.RefAttributes<View>>;
13
+ export declare function Canvas(props: CanvasProps): import("react/jsx-runtime").JSX.Element;
@@ -3,6 +3,7 @@ import { Options as ResizeOptions } from "./use-measure.js";
3
3
  import { RenderProps } from "../core/index.js";
4
4
  export interface CanvasProps extends Omit<RenderProps<HTMLCanvasElement>, 'size'>, React.HTMLAttributes<HTMLDivElement> {
5
5
  children: React.ReactNode;
6
+ ref?: React.Ref<HTMLCanvasElement>;
6
7
  /** Canvas fallback content, similar to img's alt prop */
7
8
  fallback?: React.ReactNode;
8
9
  /**
@@ -15,10 +16,8 @@ export interface CanvasProps extends Omit<RenderProps<HTMLCanvasElement>, 'size'
15
16
  /** The event prefix that is cast into canvas pointer x/y events, default: "offset" */
16
17
  eventPrefix?: 'offset' | 'client' | 'page' | 'layer' | 'screen';
17
18
  }
18
- export interface Props extends CanvasProps {
19
- }
20
19
  /**
21
20
  * A DOM canvas which accepts threejs elements as children.
22
21
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
23
22
  */
24
- export declare const Canvas: React.ForwardRefExoticComponent<CanvasProps & React.RefAttributes<HTMLCanvasElement>>;
23
+ export declare function Canvas(props: CanvasProps): import("react/jsx-runtime").JSX.Element;
@@ -358,7 +358,6 @@ function diffProps(instance, newProps) {
358
358
  // https://github.com/mrdoob/three.js/pull/22748
359
359
  const colorMaps = ['map', 'emissiveMap', 'sheenColorMap', 'specularColorMap', 'envMap'];
360
360
  const EVENT_REGEX = /^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;
361
-
362
361
  // This function applies a set of changes to the instance
363
362
  function applyProps(object, props) {
364
363
  var _instance$object;
@@ -387,7 +386,7 @@ function applyProps(object, props) {
387
386
  } = resolve(object, prop);
388
387
 
389
388
  // Copy if properties match signatures
390
- if (typeof (target == null ? void 0 : target.copy) === 'function' && target.copy === value.copy) {
389
+ if (target != null && target.copy && value != null && value.constructor && target.constructor === value.constructor) {
391
390
  target.copy(value);
392
391
  }
393
392
  // Layers have no copy function, we must therefore copy the mask property
@@ -332,7 +332,6 @@ function diffProps(instance, newProps) {
332
332
  // https://github.com/mrdoob/three.js/pull/22748
333
333
  const colorMaps = ['map', 'emissiveMap', 'sheenColorMap', 'specularColorMap', 'envMap'];
334
334
  const EVENT_REGEX = /^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;
335
-
336
335
  // This function applies a set of changes to the instance
337
336
  function applyProps(object, props) {
338
337
  var _instance$object;
@@ -361,7 +360,7 @@ function applyProps(object, props) {
361
360
  } = resolve(object, prop);
362
361
 
363
362
  // Copy if properties match signatures
364
- if (typeof (target == null ? void 0 : target.copy) === 'function' && target.copy === value.copy) {
363
+ if (target != null && target.copy && value != null && value.constructor && target.constructor === value.constructor) {
365
364
  target.copy(value);
366
365
  }
367
366
  // Layers have no copy function, we must therefore copy the mask property
@@ -358,7 +358,6 @@ function diffProps(instance, newProps) {
358
358
  // https://github.com/mrdoob/three.js/pull/22748
359
359
  const colorMaps = ['map', 'emissiveMap', 'sheenColorMap', 'specularColorMap', 'envMap'];
360
360
  const EVENT_REGEX = /^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;
361
-
362
361
  // This function applies a set of changes to the instance
363
362
  function applyProps(object, props) {
364
363
  var _instance$object;
@@ -387,7 +386,7 @@ function applyProps(object, props) {
387
386
  } = resolve(object, prop);
388
387
 
389
388
  // Copy if properties match signatures
390
- if (typeof (target == null ? void 0 : target.copy) === 'function' && target.copy === value.copy) {
389
+ if (target != null && target.copy && value != null && value.constructor && target.constructor === value.constructor) {
391
390
  target.copy(value);
392
391
  }
393
392
  // Layers have no copy function, we must therefore copy the mask property
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('./events-ec103e1e.cjs.dev.js');
5
+ var events = require('./events-c2452172.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var createDebounce = require('debounce');
@@ -232,7 +232,8 @@ function findScrollContainers(element) {
232
232
  const keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];
233
233
  const areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);
234
234
 
235
- const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
235
+ function CanvasImpl({
236
+ ref,
236
237
  children,
237
238
  fallback,
238
239
  resize,
@@ -255,7 +256,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
255
256
  onPointerMissed,
256
257
  onCreated,
257
258
  ...props
258
- }, forwardedRef) {
259
+ }) {
259
260
  // Create a known catalogue of Threejs-native elements
260
261
  // This will include the entire THREE namespace by default, users can extend
261
262
  // their own elements by using the createRoot API instead
@@ -271,7 +272,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
271
272
  });
272
273
  const canvasRef = React__namespace.useRef(null);
273
274
  const divRef = React__namespace.useRef(null);
274
- React__namespace.useImperativeHandle(forwardedRef, () => canvasRef.current);
275
+ React__namespace.useImperativeHandle(ref, () => canvasRef.current);
275
276
  const handlePointerMissed = events.useMutableCallback(onPointerMissed);
276
277
  const [block, setBlock] = React__namespace.useState(false);
277
278
  const [error, setError] = React__namespace.useState(false);
@@ -367,20 +368,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
367
368
  })
368
369
  })
369
370
  });
370
- });
371
+ }
371
372
 
372
373
  /**
373
374
  * A DOM canvas which accepts threejs elements as children.
374
375
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
375
376
  */
376
- const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
377
+ function Canvas(props) {
377
378
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
378
379
  children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
379
- ...props,
380
- ref: ref
380
+ ...props
381
381
  })
382
382
  });
383
- });
383
+ }
384
384
 
385
385
  exports.ReactThreeFiber = events.threeTypes;
386
386
  exports._roots = events._roots;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('./events-bcbe26a9.cjs.prod.js');
5
+ var events = require('./events-484fb9c5.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var createDebounce = require('debounce');
@@ -232,7 +232,8 @@ function findScrollContainers(element) {
232
232
  const keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];
233
233
  const areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);
234
234
 
235
- const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
235
+ function CanvasImpl({
236
+ ref,
236
237
  children,
237
238
  fallback,
238
239
  resize,
@@ -255,7 +256,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
255
256
  onPointerMissed,
256
257
  onCreated,
257
258
  ...props
258
- }, forwardedRef) {
259
+ }) {
259
260
  // Create a known catalogue of Threejs-native elements
260
261
  // This will include the entire THREE namespace by default, users can extend
261
262
  // their own elements by using the createRoot API instead
@@ -271,7 +272,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
271
272
  });
272
273
  const canvasRef = React__namespace.useRef(null);
273
274
  const divRef = React__namespace.useRef(null);
274
- React__namespace.useImperativeHandle(forwardedRef, () => canvasRef.current);
275
+ React__namespace.useImperativeHandle(ref, () => canvasRef.current);
275
276
  const handlePointerMissed = events.useMutableCallback(onPointerMissed);
276
277
  const [block, setBlock] = React__namespace.useState(false);
277
278
  const [error, setError] = React__namespace.useState(false);
@@ -367,20 +368,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(function Canvas({
367
368
  })
368
369
  })
369
370
  });
370
- });
371
+ }
371
372
 
372
373
  /**
373
374
  * A DOM canvas which accepts threejs elements as children.
374
375
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
375
376
  */
376
- const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
377
+ function Canvas(props) {
377
378
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
378
379
  children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
379
- ...props,
380
- ref: ref
380
+ ...props
381
381
  })
382
382
  });
383
- });
383
+ }
384
384
 
385
385
  exports.ReactThreeFiber = events.threeTypes;
386
386
  exports._roots = events._roots;
@@ -1,5 +1,5 @@
1
- import { e as extend, u as useBridge, a as useMutableCallback, b as useIsomorphicLayoutEffect, c as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents } from './events-89bb769e.esm.js';
2
- export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from './events-89bb769e.esm.js';
1
+ import { e as extend, u as useBridge, a as useMutableCallback, b as useIsomorphicLayoutEffect, c as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents } from './events-64d1e225.esm.js';
2
+ export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from './events-64d1e225.esm.js';
3
3
  import * as React from 'react';
4
4
  import { useState, useRef, useEffect, useMemo } from 'react';
5
5
  import * as THREE from 'three';
@@ -206,7 +206,8 @@ function findScrollContainers(element) {
206
206
  const keys = ['x', 'y', 'top', 'bottom', 'left', 'right', 'width', 'height'];
207
207
  const areBoundsEqual = (a, b) => keys.every(key => a[key] === b[key]);
208
208
 
209
- const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
209
+ function CanvasImpl({
210
+ ref,
210
211
  children,
211
212
  fallback,
212
213
  resize,
@@ -229,7 +230,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
229
230
  onPointerMissed,
230
231
  onCreated,
231
232
  ...props
232
- }, forwardedRef) {
233
+ }) {
233
234
  // Create a known catalogue of Threejs-native elements
234
235
  // This will include the entire THREE namespace by default, users can extend
235
236
  // their own elements by using the createRoot API instead
@@ -245,7 +246,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
245
246
  });
246
247
  const canvasRef = React.useRef(null);
247
248
  const divRef = React.useRef(null);
248
- React.useImperativeHandle(forwardedRef, () => canvasRef.current);
249
+ React.useImperativeHandle(ref, () => canvasRef.current);
249
250
  const handlePointerMissed = useMutableCallback(onPointerMissed);
250
251
  const [block, setBlock] = React.useState(false);
251
252
  const [error, setError] = React.useState(false);
@@ -341,19 +342,18 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(function Canvas({
341
342
  })
342
343
  })
343
344
  });
344
- });
345
+ }
345
346
 
346
347
  /**
347
348
  * A DOM canvas which accepts threejs elements as children.
348
349
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
349
350
  */
350
- const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
351
+ function Canvas(props) {
351
352
  return /*#__PURE__*/jsx(FiberProvider, {
352
353
  children: /*#__PURE__*/jsx(CanvasImpl, {
353
- ...props,
354
- ref: ref
354
+ ...props
355
355
  })
356
356
  });
357
- });
357
+ }
358
358
 
359
359
  export { Canvas };
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('../../dist/events-ec103e1e.cjs.dev.js');
5
+ var events = require('../../dist/events-c2452172.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var reactNative = require('react-native');
@@ -43,11 +43,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
43
43
 
44
44
  // TODO: React 19 needs support from react-native
45
45
  const _View = reactNative.View;
46
- /**
47
- * A native canvas which accepts threejs elements as children.
48
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
49
- */
50
- const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
46
+ function CanvasImpl({
51
47
  children,
52
48
  style,
53
49
  gl,
@@ -64,8 +60,9 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
64
60
  scene,
65
61
  onPointerMissed,
66
62
  onCreated,
63
+ ref,
67
64
  ...props
68
- }, forwardedRef) => {
65
+ }) {
69
66
  // Create a known catalogue of Threejs-native elements
70
67
  // This will include the entire THREE namespace by default, users can extend
71
68
  // their own elements by using the createRoot API instead
@@ -84,7 +81,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
84
81
  });
85
82
  const [canvas, setCanvas] = React__namespace.useState(null);
86
83
  const [bind, setBind] = React__namespace.useState();
87
- React__namespace.useImperativeHandle(forwardedRef, () => viewRef.current);
84
+ React__namespace.useImperativeHandle(ref, () => viewRef.current);
88
85
  const handlePointerMissed = events.useMutableCallback(onPointerMissed);
89
86
  const [block, setBlock] = React__namespace.useState(false);
90
87
  const [error, setError] = React__namespace.useState(undefined);
@@ -265,20 +262,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
265
262
  style: reactNative.StyleSheet.absoluteFill
266
263
  })
267
264
  });
268
- });
265
+ }
269
266
 
270
267
  /**
271
268
  * A native canvas which accepts threejs elements as children.
272
269
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
273
270
  */
274
- const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
271
+ function Canvas(props) {
275
272
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
276
273
  children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
277
- ...props,
278
- ref: ref
274
+ ...props
279
275
  })
280
276
  });
281
- });
277
+ }
282
278
 
283
279
  /** Default R3F event manager for react-native */
284
280
  function createTouchEvents(store) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('../../dist/events-bcbe26a9.cjs.prod.js');
5
+ var events = require('../../dist/events-484fb9c5.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var reactNative = require('react-native');
@@ -43,11 +43,7 @@ var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
43
43
 
44
44
  // TODO: React 19 needs support from react-native
45
45
  const _View = reactNative.View;
46
- /**
47
- * A native canvas which accepts threejs elements as children.
48
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
49
- */
50
- const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
46
+ function CanvasImpl({
51
47
  children,
52
48
  style,
53
49
  gl,
@@ -64,8 +60,9 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
64
60
  scene,
65
61
  onPointerMissed,
66
62
  onCreated,
63
+ ref,
67
64
  ...props
68
- }, forwardedRef) => {
65
+ }) {
69
66
  // Create a known catalogue of Threejs-native elements
70
67
  // This will include the entire THREE namespace by default, users can extend
71
68
  // their own elements by using the createRoot API instead
@@ -84,7 +81,7 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
84
81
  });
85
82
  const [canvas, setCanvas] = React__namespace.useState(null);
86
83
  const [bind, setBind] = React__namespace.useState();
87
- React__namespace.useImperativeHandle(forwardedRef, () => viewRef.current);
84
+ React__namespace.useImperativeHandle(ref, () => viewRef.current);
88
85
  const handlePointerMissed = events.useMutableCallback(onPointerMissed);
89
86
  const [block, setBlock] = React__namespace.useState(false);
90
87
  const [error, setError] = React__namespace.useState(undefined);
@@ -265,20 +262,19 @@ const CanvasImpl = /*#__PURE__*/React__namespace.forwardRef(({
265
262
  style: reactNative.StyleSheet.absoluteFill
266
263
  })
267
264
  });
268
- });
265
+ }
269
266
 
270
267
  /**
271
268
  * A native canvas which accepts threejs elements as children.
272
269
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
273
270
  */
274
- const Canvas = /*#__PURE__*/React__namespace.forwardRef(function CanvasWrapper(props, ref) {
271
+ function Canvas(props) {
275
272
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
276
273
  children: /*#__PURE__*/jsxRuntime.jsx(CanvasImpl, {
277
- ...props,
278
- ref: ref
274
+ ...props
279
275
  })
280
276
  });
281
- });
277
+ }
282
278
 
283
279
  /** Default R3F event manager for react-native */
284
280
  function createTouchEvents(store) {
@@ -1,5 +1,5 @@
1
- import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-89bb769e.esm.js';
2
- export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from '../../dist/events-89bb769e.esm.js';
1
+ import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-64d1e225.esm.js';
2
+ export { t as ReactThreeFiber, _ as _roots, x as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, s as applyProps, y as buildGraph, q as context, g as createEvents, p as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, v as getRootState, m as invalidate, r as reconciler, o as render, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from '../../dist/events-64d1e225.esm.js';
3
3
  import * as React from 'react';
4
4
  import * as THREE from 'three';
5
5
  import { PanResponder, PixelRatio, StyleSheet, View, Platform, Image, NativeModules } from 'react-native';
@@ -18,11 +18,7 @@ import 'suspend-react';
18
18
 
19
19
  // TODO: React 19 needs support from react-native
20
20
  const _View = View;
21
- /**
22
- * A native canvas which accepts threejs elements as children.
23
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
24
- */
25
- const CanvasImpl = /*#__PURE__*/React.forwardRef(({
21
+ function CanvasImpl({
26
22
  children,
27
23
  style,
28
24
  gl,
@@ -39,8 +35,9 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
39
35
  scene,
40
36
  onPointerMissed,
41
37
  onCreated,
38
+ ref,
42
39
  ...props
43
- }, forwardedRef) => {
40
+ }) {
44
41
  // Create a known catalogue of Threejs-native elements
45
42
  // This will include the entire THREE namespace by default, users can extend
46
43
  // their own elements by using the createRoot API instead
@@ -59,7 +56,7 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
59
56
  });
60
57
  const [canvas, setCanvas] = React.useState(null);
61
58
  const [bind, setBind] = React.useState();
62
- React.useImperativeHandle(forwardedRef, () => viewRef.current);
59
+ React.useImperativeHandle(ref, () => viewRef.current);
63
60
  const handlePointerMissed = useMutableCallback(onPointerMissed);
64
61
  const [block, setBlock] = React.useState(false);
65
62
  const [error, setError] = React.useState(undefined);
@@ -240,20 +237,19 @@ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
240
237
  style: StyleSheet.absoluteFill
241
238
  })
242
239
  });
243
- });
240
+ }
244
241
 
245
242
  /**
246
243
  * A native canvas which accepts threejs elements as children.
247
244
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
248
245
  */
249
- const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
246
+ function Canvas(props) {
250
247
  return /*#__PURE__*/jsx(FiberProvider, {
251
248
  children: /*#__PURE__*/jsx(CanvasImpl, {
252
- ...props,
253
- ref: ref
249
+ ...props
254
250
  })
255
251
  });
256
- });
252
+ }
257
253
 
258
254
  /** Default R3F event manager for react-native */
259
255
  function createTouchEvents(store) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "9.0.0-rc.2",
3
+ "version": "9.0.0-rc.4",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",
@@ -62,7 +62,7 @@
62
62
  "expo-file-system": ">=11.0",
63
63
  "react": "^19.0.0",
64
64
  "react-dom": "^19.0.0",
65
- "react-native": ">=0.69",
65
+ "react-native": ">=0.78",
66
66
  "three": ">=0.156"
67
67
  },
68
68
  "peerDependenciesMeta": {