@react-three/fiber 9.1.3 → 9.2.0

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +1160 -1148
  2. package/dist/declarations/src/core/events.d.ts +92 -92
  3. package/dist/declarations/src/core/hooks.d.ts +53 -53
  4. package/dist/declarations/src/core/index.d.ts +13 -13
  5. package/dist/declarations/src/core/loop.d.ts +31 -31
  6. package/dist/declarations/src/core/reconciler.d.ts +50 -50
  7. package/dist/declarations/src/core/renderer.d.ts +89 -89
  8. package/dist/declarations/src/core/store.d.ts +130 -130
  9. package/dist/declarations/src/core/utils.d.ts +191 -191
  10. package/dist/declarations/src/index.d.ts +6 -6
  11. package/dist/declarations/src/native/Canvas.d.ts +13 -13
  12. package/dist/declarations/src/native/events.d.ts +4 -4
  13. package/dist/declarations/src/native.d.ts +6 -6
  14. package/dist/declarations/src/three-types.d.ts +68 -67
  15. package/dist/declarations/src/web/Canvas.d.ts +23 -23
  16. package/dist/declarations/src/web/events.d.ts +4 -4
  17. package/dist/{events-a96a0963.cjs.prod.js → events-59fae97e.cjs.prod.js} +90 -79
  18. package/dist/{events-f681e724.esm.js → events-cf57b220.esm.js} +90 -80
  19. package/dist/{events-66111f5e.cjs.dev.js → events-e63d28a3.cjs.dev.js} +90 -79
  20. package/dist/react-three-fiber.cjs.dev.js +5 -4
  21. package/dist/react-three-fiber.cjs.prod.js +5 -4
  22. package/dist/react-three-fiber.esm.js +5 -5
  23. package/native/dist/react-three-fiber-native.cjs.dev.js +5 -4
  24. package/native/dist/react-three-fiber-native.cjs.prod.js +5 -4
  25. package/native/dist/react-three-fiber-native.esm.js +5 -5
  26. package/native/package.json +5 -5
  27. package/package.json +1 -1
  28. package/readme.md +253 -253
@@ -38,17 +38,17 @@ var threeTypes = /*#__PURE__*/Object.freeze({
38
38
  __proto__: null
39
39
  });
40
40
 
41
- /**
42
- * Returns the instance's initial (outmost) root.
41
+ /**
42
+ * Returns the instance's initial (outmost) root.
43
43
  */
44
44
  function findInitialRoot(instance) {
45
45
  let root = instance.root;
46
46
  while (root.getState().previousRoot) root = root.getState().previousRoot;
47
47
  return root;
48
48
  }
49
- /**
50
- * Safely flush async effects when testing, simulating a legacy root.
51
- * @deprecated Import from React instead. import { act } from 'react'
49
+ /**
50
+ * Safely flush async effects when testing, simulating a legacy root.
51
+ * @deprecated Import from React instead. import { act } from 'react'
52
52
  */
53
53
  // Reference with computed key to break Webpack static analysis
54
54
  // https://github.com/webpack/webpack/issues/14814
@@ -57,14 +57,14 @@ const isOrthographicCamera = def => def && def.isOrthographicCamera;
57
57
  const isRef = obj => obj && obj.hasOwnProperty('current');
58
58
  const isColorRepresentation = value => value != null && (typeof value === 'string' || typeof value === 'number' || value.isColor);
59
59
 
60
- /**
61
- * An SSR-friendly useLayoutEffect.
62
- *
63
- * React currently throws a warning when using useLayoutEffect on the server.
64
- * To get around it, we can conditionally useEffect on the server (no-op) and
65
- * useLayoutEffect elsewhere.
66
- *
67
- * @see https://github.com/facebook/react/issues/14927
60
+ /**
61
+ * An SSR-friendly useLayoutEffect.
62
+ *
63
+ * React currently throws a warning when using useLayoutEffect on the server.
64
+ * To get around it, we can conditionally useEffect on the server (no-op) and
65
+ * useLayoutEffect elsewhere.
66
+ *
67
+ * @see https://github.com/facebook/react/issues/14927
68
68
  */
69
69
  const useIsomorphicLayoutEffect = /* @__PURE__ */((_window$document, _window$navigator) => typeof window !== 'undefined' && (((_window$document = window.document) == null ? void 0 : _window$document.createElement) || ((_window$navigator = window.navigator) == null ? void 0 : _window$navigator.product) === 'ReactNative'))() ? React__namespace.useLayoutEffect : React__namespace.useEffect;
70
70
  function useMutableCallback(fn) {
@@ -72,8 +72,8 @@ function useMutableCallback(fn) {
72
72
  useIsomorphicLayoutEffect(() => void (ref.current = fn), [fn]);
73
73
  return ref;
74
74
  }
75
- /**
76
- * Bridges renderer Context and StrictMode from a primary renderer.
75
+ /**
76
+ * Bridges renderer Context and StrictMode from a primary renderer.
77
77
  */
78
78
  function useBridge() {
79
79
  const fiber = itsFine.useFiber();
@@ -125,8 +125,8 @@ function calculateDpr(dpr) {
125
125
  return Array.isArray(dpr) ? Math.min(Math.max(dpr[0], target), dpr[1]) : dpr;
126
126
  }
127
127
 
128
- /**
129
- * Returns instance root state
128
+ /**
129
+ * Returns instance root state
130
130
  */
131
131
  function getRootState(obj) {
132
132
  var _r3f;
@@ -489,9 +489,9 @@ function makeId(event) {
489
489
  return (event.eventObject || event.object).uuid + '/' + event.index + event.instanceId;
490
490
  }
491
491
 
492
- /**
493
- * Release pointer captures.
494
- * This is called by releasePointerCapture in the API, and when an object is removed.
492
+ /**
493
+ * Release pointer captures.
494
+ * This is called by releasePointerCapture in the API, and when an object is removed.
495
495
  */
496
496
  function releaseInternalPointerCapture(capturedMap, obj, captures, pointerId) {
497
497
  const captureData = captures.get(obj);
@@ -838,19 +838,19 @@ function createEvents(store) {
838
838
  if (!(instance != null && instance.eventCount)) return;
839
839
  const handlers = instance.handlers;
840
840
 
841
- /*
842
- MAYBE TODO, DELETE IF NOT:
843
- Check if the object is captured, captured events should not have intersects running in parallel
844
- But wouldn't it be better to just replace capturedMap with a single entry?
845
- Also, are we OK with straight up making picking up multiple objects impossible?
846
-
847
- const pointerId = (data as ThreeEvent<PointerEvent>).pointerId
848
- if (pointerId !== undefined) {
849
- const capturedMeshSet = internal.capturedMap.get(pointerId)
850
- if (capturedMeshSet) {
851
- const captured = capturedMeshSet.get(eventObject)
852
- if (captured && captured.localState.stopped) return
853
- }
841
+ /*
842
+ MAYBE TODO, DELETE IF NOT:
843
+ Check if the object is captured, captured events should not have intersects running in parallel
844
+ But wouldn't it be better to just replace capturedMap with a single entry?
845
+ Also, are we OK with straight up making picking up multiple objects impossible?
846
+
847
+ const pointerId = (data as ThreeEvent<PointerEvent>).pointerId
848
+ if (pointerId !== undefined) {
849
+ const capturedMeshSet = internal.capturedMap.get(pointerId)
850
+ if (capturedMeshSet) {
851
+ const captured = capturedMeshSet.get(eventObject)
852
+ if (captured && captured.localState.stopped) return
853
+ }
854
854
  }*/
855
855
 
856
856
  if (isPointerMove) {
@@ -1141,11 +1141,11 @@ const createStore = (invalidate, advance) => {
1141
1141
  return rootStore;
1142
1142
  };
1143
1143
 
1144
- /**
1145
- * Exposes an object's {@link Instance}.
1146
- * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#useInstanceHandle
1147
- *
1148
- * **Note**: this is an escape hatch to react-internal fields. Expect this to change significantly between versions.
1144
+ /**
1145
+ * Exposes an object's {@link Instance}.
1146
+ * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#useInstanceHandle
1147
+ *
1148
+ * **Note**: this is an escape hatch to react-internal fields. Expect this to change significantly between versions.
1149
1149
  */
1150
1150
  function useInstanceHandle(ref) {
1151
1151
  const instance = React__namespace.useRef(null);
@@ -1153,9 +1153,9 @@ function useInstanceHandle(ref) {
1153
1153
  return instance;
1154
1154
  }
1155
1155
 
1156
- /**
1157
- * Returns the R3F Canvas' Zustand store. Useful for [transient updates](https://github.com/pmndrs/zustand#transient-updates-for-often-occurring-state-changes).
1158
- * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usestore
1156
+ /**
1157
+ * Returns the R3F Canvas' Zustand store. Useful for [transient updates](https://github.com/pmndrs/zustand#transient-updates-for-often-occurring-state-changes).
1158
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usestore
1159
1159
  */
1160
1160
  function useStore() {
1161
1161
  const store = React__namespace.useContext(context);
@@ -1163,18 +1163,18 @@ function useStore() {
1163
1163
  return store;
1164
1164
  }
1165
1165
 
1166
- /**
1167
- * Accesses R3F's internal state, containing renderer, canvas, scene, etc.
1168
- * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usethree
1166
+ /**
1167
+ * Accesses R3F's internal state, containing renderer, canvas, scene, etc.
1168
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usethree
1169
1169
  */
1170
1170
  function useThree(selector = state => state, equalityFn) {
1171
1171
  return useStore()(selector, equalityFn);
1172
1172
  }
1173
1173
 
1174
- /**
1175
- * Executes a callback before render in a shared frame loop.
1176
- * Can order effects with render priority or manually render with a positive priority.
1177
- * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
1174
+ /**
1175
+ * Executes a callback before render in a shared frame loop.
1176
+ * Can order effects with render priority or manually render with a positive priority.
1177
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useframe
1178
1178
  */
1179
1179
  function useFrame(callback, renderPriority = 0) {
1180
1180
  const store = useStore();
@@ -1186,9 +1186,9 @@ function useFrame(callback, renderPriority = 0) {
1186
1186
  return null;
1187
1187
  }
1188
1188
 
1189
- /**
1190
- * Returns a node graph of an object with named nodes & materials.
1191
- * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usegraph
1189
+ /**
1190
+ * Returns a node graph of an object with named nodes & materials.
1191
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#usegraph
1192
1192
  */
1193
1193
  function useGraph(object) {
1194
1194
  return React__namespace.useMemo(() => buildGraph(object), [object]);
@@ -1224,11 +1224,11 @@ function loadingFn(extensions, onProgress) {
1224
1224
  };
1225
1225
  }
1226
1226
 
1227
- /**
1228
- * Synchronously loads and caches assets with a three loader.
1229
- *
1230
- * Note: this hook's caller must be wrapped with `React.Suspense`
1231
- * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useloader
1227
+ /**
1228
+ * Synchronously loads and caches assets with a three loader.
1229
+ *
1230
+ * Note: this hook's caller must be wrapped with `React.Suspense`
1231
+ * @see https://docs.pmnd.rs/react-three-fiber/api/hooks#useloader
1232
1232
  */
1233
1233
  function useLoader(loader, input, extensions, onProgress) {
1234
1234
  // Use suspense to load async assets
@@ -1240,16 +1240,16 @@ function useLoader(loader, input, extensions, onProgress) {
1240
1240
  return Array.isArray(input) ? results : results[0];
1241
1241
  }
1242
1242
 
1243
- /**
1244
- * Preloads an asset into cache as a side-effect.
1243
+ /**
1244
+ * Preloads an asset into cache as a side-effect.
1245
1245
  */
1246
1246
  useLoader.preload = function (loader, input, extensions) {
1247
1247
  const keys = Array.isArray(input) ? input : [input];
1248
1248
  return suspendReact.preload(loadingFn(extensions), [loader, ...keys]);
1249
1249
  };
1250
1250
 
1251
- /**
1252
- * Removes a loaded asset from cache.
1251
+ /**
1252
+ * Removes a loaded asset from cache.
1253
1253
  */
1254
1254
  useLoader.clear = function (loader, input) {
1255
1255
  const keys = Array.isArray(input) ? input : [input];
@@ -2083,10 +2083,10 @@ function Portal({
2083
2083
  children,
2084
2084
  container
2085
2085
  }) {
2086
- /** This has to be a component because it would not be able to call useThree/useStore otherwise since
2087
- * if this is our environment, then we are not in r3f's renderer but in react-dom, it would trigger
2088
- * the "R3F hooks can only be used within the Canvas component!" warning:
2089
- * <Canvas>
2086
+ /** This has to be a component because it would not be able to call useThree/useStore otherwise since
2087
+ * if this is our environment, then we are not in r3f's renderer but in react-dom, it would trigger
2088
+ * the "R3F hooks can only be used within the Canvas component!" warning:
2089
+ * <Canvas>
2090
2090
  * {createPortal(...)} */
2091
2091
  const {
2092
2092
  events,
@@ -2167,6 +2167,16 @@ function Portal({
2167
2167
  );
2168
2168
  }
2169
2169
 
2170
+ /**
2171
+ * Force React to flush any updates inside the provided callback synchronously and immediately.
2172
+ * All the same caveats documented for react-dom's `flushSync` apply here (see https://react.dev/reference/react-dom/flushSync).
2173
+ * Nevertheless, sometimes one needs to render synchronously, for example to keep DOM and 3D changes in lock-step without
2174
+ * having to revert to a non-React solution.
2175
+ */
2176
+ function flushSync(fn) {
2177
+ return reconciler.flushSync(fn);
2178
+ }
2179
+
2170
2180
  function createSubs(callback, subs) {
2171
2181
  const sub = {
2172
2182
  callback
@@ -2178,21 +2188,21 @@ const globalEffects = new Set();
2178
2188
  const globalAfterEffects = new Set();
2179
2189
  const globalTailEffects = new Set();
2180
2190
 
2181
- /**
2182
- * Adds a global render callback which is called each frame.
2183
- * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#addEffect
2191
+ /**
2192
+ * Adds a global render callback which is called each frame.
2193
+ * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#addEffect
2184
2194
  */
2185
2195
  const addEffect = callback => createSubs(callback, globalEffects);
2186
2196
 
2187
- /**
2188
- * Adds a global after-render callback which is called each frame.
2189
- * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#addAfterEffect
2197
+ /**
2198
+ * Adds a global after-render callback which is called each frame.
2199
+ * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#addAfterEffect
2190
2200
  */
2191
2201
  const addAfterEffect = callback => createSubs(callback, globalAfterEffects);
2192
2202
 
2193
- /**
2194
- * Adds a global callback which is called when rendering stops.
2195
- * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#addTail
2203
+ /**
2204
+ * Adds a global callback which is called when rendering stops.
2205
+ * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#addTail
2196
2206
  */
2197
2207
  const addTail = callback => createSubs(callback, globalTailEffects);
2198
2208
  function run(effects, timestamp) {
@@ -2280,9 +2290,9 @@ function loop(timestamp) {
2280
2290
  }
2281
2291
  }
2282
2292
 
2283
- /**
2284
- * Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
2285
- * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
2293
+ /**
2294
+ * Invalidates the view, requesting a frame to be rendered. Will globally invalidate unless passed a root's state.
2295
+ * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#invalidate
2286
2296
  */
2287
2297
  function invalidate(state, frames = 1) {
2288
2298
  var _state$gl$xr2;
@@ -2309,9 +2319,9 @@ function invalidate(state, frames = 1) {
2309
2319
  }
2310
2320
  }
2311
2321
 
2312
- /**
2313
- * Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
2314
- * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
2322
+ /**
2323
+ * Advances the frameloop and runs render effects, useful for when manually rendering via `frameloop="never"`.
2324
+ * @see https://docs.pmnd.rs/react-three-fiber/api/additional-exports#advance
2315
2325
  */
2316
2326
  function advance(timestamp, runGlobalEffects = true, state, frame) {
2317
2327
  if (runGlobalEffects) flushGlobalEffects('before', timestamp);
@@ -2423,6 +2433,7 @@ exports.createRoot = createRoot;
2423
2433
  exports.dispose = dispose;
2424
2434
  exports.extend = extend;
2425
2435
  exports.flushGlobalEffects = flushGlobalEffects;
2436
+ exports.flushSync = flushSync;
2426
2437
  exports.getRootState = getRootState;
2427
2438
  exports.invalidate = invalidate;
2428
2439
  exports.isRef = isRef;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('./events-66111f5e.cjs.dev.js');
5
+ var events = require('./events-e63d28a3.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var useMeasure = require('react-use-measure');
@@ -179,9 +179,9 @@ function CanvasImpl({
179
179
  });
180
180
  }
181
181
 
182
- /**
183
- * A DOM canvas which accepts threejs elements as children.
184
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
182
+ /**
183
+ * A DOM canvas which accepts threejs elements as children.
184
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
185
185
  */
186
186
  function Canvas(props) {
187
187
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
@@ -208,6 +208,7 @@ exports.dispose = events.dispose;
208
208
  exports.events = events.createPointerEvents;
209
209
  exports.extend = events.extend;
210
210
  exports.flushGlobalEffects = events.flushGlobalEffects;
211
+ exports.flushSync = events.flushSync;
211
212
  exports.getRootState = events.getRootState;
212
213
  exports.invalidate = events.invalidate;
213
214
  exports.reconciler = events.reconciler;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('./events-a96a0963.cjs.prod.js');
5
+ var events = require('./events-59fae97e.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var useMeasure = require('react-use-measure');
@@ -179,9 +179,9 @@ function CanvasImpl({
179
179
  });
180
180
  }
181
181
 
182
- /**
183
- * A DOM canvas which accepts threejs elements as children.
184
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
182
+ /**
183
+ * A DOM canvas which accepts threejs elements as children.
184
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
185
185
  */
186
186
  function Canvas(props) {
187
187
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
@@ -208,6 +208,7 @@ exports.dispose = events.dispose;
208
208
  exports.events = events.createPointerEvents;
209
209
  exports.extend = events.extend;
210
210
  exports.flushGlobalEffects = events.flushGlobalEffects;
211
+ exports.flushSync = events.flushSync;
211
212
  exports.getRootState = events.getRootState;
212
213
  exports.invalidate = events.invalidate;
213
214
  exports.reconciler = events.reconciler;
@@ -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-f681e724.esm.js';
2
- export { t as ReactThreeFiber, _ as _roots, w as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, q as applyProps, x as buildGraph, p as context, g as createEvents, o as createPortal, c as createRoot, v as dispose, f as events, e as extend, h as flushGlobalEffects, s as getRootState, m as invalidate, r as reconciler, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './events-f681e724.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-cf57b220.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, o as createPortal, c as createRoot, w as dispose, f as events, e as extend, h as flushGlobalEffects, p as flushSync, v as getRootState, m as invalidate, r as reconciler, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from './events-cf57b220.esm.js';
3
3
  import * as React from 'react';
4
4
  import * as THREE from 'three';
5
5
  import useMeasure from 'react-use-measure';
@@ -152,9 +152,9 @@ function CanvasImpl({
152
152
  });
153
153
  }
154
154
 
155
- /**
156
- * A DOM canvas which accepts threejs elements as children.
157
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
155
+ /**
156
+ * A DOM canvas which accepts threejs elements as children.
157
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
158
158
  */
159
159
  function Canvas(props) {
160
160
  return /*#__PURE__*/jsx(FiberProvider, {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('../../dist/events-66111f5e.cjs.dev.js');
5
+ var events = require('../../dist/events-e63d28a3.cjs.dev.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var reactNative = require('react-native');
@@ -273,9 +273,9 @@ function CanvasImpl({
273
273
  });
274
274
  }
275
275
 
276
- /**
277
- * A native canvas which accepts threejs elements as children.
278
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
276
+ /**
277
+ * A native canvas which accepts threejs elements as children.
278
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
279
279
  */
280
280
  function Canvas(props) {
281
281
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
@@ -544,6 +544,7 @@ exports.createRoot = events.createRoot;
544
544
  exports.dispose = events.dispose;
545
545
  exports.extend = events.extend;
546
546
  exports.flushGlobalEffects = events.flushGlobalEffects;
547
+ exports.flushSync = events.flushSync;
547
548
  exports.getRootState = events.getRootState;
548
549
  exports.invalidate = events.invalidate;
549
550
  exports.reconciler = events.reconciler;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var events = require('../../dist/events-a96a0963.cjs.prod.js');
5
+ var events = require('../../dist/events-59fae97e.cjs.prod.js');
6
6
  var React = require('react');
7
7
  var THREE = require('three');
8
8
  var reactNative = require('react-native');
@@ -273,9 +273,9 @@ function CanvasImpl({
273
273
  });
274
274
  }
275
275
 
276
- /**
277
- * A native canvas which accepts threejs elements as children.
278
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
276
+ /**
277
+ * A native canvas which accepts threejs elements as children.
278
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
279
279
  */
280
280
  function Canvas(props) {
281
281
  return /*#__PURE__*/jsxRuntime.jsx(itsFine.FiberProvider, {
@@ -544,6 +544,7 @@ exports.createRoot = events.createRoot;
544
544
  exports.dispose = events.dispose;
545
545
  exports.extend = events.extend;
546
546
  exports.flushGlobalEffects = events.flushGlobalEffects;
547
+ exports.flushSync = events.flushSync;
547
548
  exports.getRootState = events.getRootState;
548
549
  exports.invalidate = events.invalidate;
549
550
  exports.reconciler = events.reconciler;
@@ -1,5 +1,5 @@
1
- import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, b as useIsomorphicLayoutEffect, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-f681e724.esm.js';
2
- export { t as ReactThreeFiber, _ as _roots, w as act, k as addAfterEffect, j as addEffect, l as addTail, n as advance, q as applyProps, x as buildGraph, p as context, g as createEvents, o as createPortal, c as createRoot, v as dispose, e as extend, h as flushGlobalEffects, s as getRootState, m as invalidate, r as reconciler, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/events-f681e724.esm.js';
1
+ import { e as extend, u as useBridge, a as useMutableCallback, c as createRoot, b as useIsomorphicLayoutEffect, E as ErrorBoundary, B as Block, d as unmountComponentAtNode, f as createPointerEvents, g as createEvents } from '../../dist/events-cf57b220.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, o as createPortal, c as createRoot, w as dispose, e as extend, h as flushGlobalEffects, p as flushSync, v as getRootState, m as invalidate, r as reconciler, d as unmountComponentAtNode, D as useFrame, F as useGraph, z as useInstanceHandle, G as useLoader, A as useStore, C as useThree } from '../../dist/events-cf57b220.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';
@@ -248,9 +248,9 @@ function CanvasImpl({
248
248
  });
249
249
  }
250
250
 
251
- /**
252
- * A native canvas which accepts threejs elements as children.
253
- * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
251
+ /**
252
+ * A native canvas which accepts threejs elements as children.
253
+ * @see https://docs.pmnd.rs/react-three-fiber/api/canvas
254
254
  */
255
255
  function Canvas(props) {
256
256
  return /*#__PURE__*/jsx(FiberProvider, {
@@ -1,5 +1,5 @@
1
- {
2
- "main": "dist/react-three-fiber-native.cjs.js",
3
- "module": "dist/react-three-fiber-native.esm.js",
4
- "types": "dist/react-three-fiber-native.cjs.d.ts"
5
- }
1
+ {
2
+ "main": "dist/react-three-fiber-native.cjs.js",
3
+ "module": "dist/react-three-fiber-native.esm.js",
4
+ "types": "dist/react-three-fiber-native.cjs.d.ts"
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "9.1.3",
3
+ "version": "9.2.0",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",