@react-three/fiber 8.8.0 → 8.8.1

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.
@@ -1,10 +1,11 @@
1
- import { c as createEvents, e as extend, u as useContextBridge, a as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, f as unmountComponentAtNode, F as FiberProvider } from '../../dist/index-f01196c6.esm.js';
2
- export { t as ReactThreeFiber, w as _roots, v as act, p as addAfterEffect, o as addEffect, q as addTail, n as advance, k as applyProps, g as context, h as createPortal, b as createRoot, l as dispose, e as extend, s as getRootState, m as invalidate, j as reconciler, r as render, f as unmountComponentAtNode, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-f01196c6.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-80784ca9.esm.js';
2
+ export { t as ReactThreeFiber, v as _roots, s as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, g as createPortal, a as createRoot, k as dispose, e as extend, q as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, z as useFrame, A as useGraph, w as useInstanceHandle, C as useLoader, x as useStore, y as useThree } from '../../dist/index-80784ca9.esm.js';
3
3
  import _extends from '@babel/runtime/helpers/esm/extends';
4
4
  import * as React from 'react';
5
5
  import * as THREE from 'three';
6
6
  import { PixelRatio, View, StyleSheet } from 'react-native';
7
7
  import { GLView } from 'expo-gl';
8
+ import { FiberProvider, useContextBridge } from 'its-fine';
8
9
  import Pressability from 'react-native/Libraries/Pressability/Pressability';
9
10
  import 'react-reconciler/constants';
10
11
  import 'zustand';
@@ -209,7 +210,7 @@ function polyfills() {
209
210
  * A native canvas which accepts threejs elements as children.
210
211
  * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
211
212
  */
212
- const Canvas = /*#__PURE__*/React.forwardRef(({
213
+ const CanvasImpl = /*#__PURE__*/React.forwardRef(({
213
214
  children,
214
215
  style,
215
216
  gl,
@@ -231,8 +232,7 @@ const Canvas = /*#__PURE__*/React.forwardRef(({
231
232
  // This will include the entire THREE namespace by default, users can extend
232
233
  // their own elements by using the createRoot API instead
233
234
  React.useMemo(() => extend(THREE), []);
234
- const [fiber, setFiber] = React.useState(null);
235
- const Bridge = useContextBridge(fiber);
235
+ const Bridge = useContextBridge();
236
236
  const [{
237
237
  width,
238
238
  height,
@@ -343,9 +343,7 @@ const Canvas = /*#__PURE__*/React.forwardRef(({
343
343
  return () => unmountComponentAtNode(canvas);
344
344
  }
345
345
  }, [canvas]);
346
- return /*#__PURE__*/React.createElement(FiberProvider, {
347
- setFiber: setFiber
348
- }, /*#__PURE__*/React.createElement(View, _extends({}, props, {
346
+ return /*#__PURE__*/React.createElement(View, _extends({}, props, {
349
347
  ref: viewRef,
350
348
  onLayout: onLayout,
351
349
  style: {
@@ -355,6 +353,16 @@ const Canvas = /*#__PURE__*/React.forwardRef(({
355
353
  }, bind), width > 0 && /*#__PURE__*/React.createElement(GLView, {
356
354
  onContextCreate: onContextCreate,
357
355
  style: StyleSheet.absoluteFill
356
+ }));
357
+ });
358
+ /**
359
+ * A native canvas which accepts threejs elements as children.
360
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
361
+ */
362
+
363
+ const Canvas = /*#__PURE__*/React.forwardRef(function CanvasWrapper(props, ref) {
364
+ return /*#__PURE__*/React.createElement(FiberProvider, null, /*#__PURE__*/React.createElement(CanvasImpl, _extends({}, props, {
365
+ ref: ref
358
366
  })));
359
367
  });
360
368
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.8.0",
3
+ "version": "8.8.1",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",
@@ -44,6 +44,7 @@
44
44
  "dependencies": {
45
45
  "@babel/runtime": "^7.17.8",
46
46
  "@types/react-reconciler": "^0.26.7",
47
+ "its-fine": "^1.0.0",
47
48
  "react-reconciler": "^0.27.0",
48
49
  "react-use-measure": "^2.1.1",
49
50
  "scheduler": "^0.21.0",