@react-three/fiber 8.15.9 → 8.15.10

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @react-three/fiber
2
2
 
3
+ ## 8.15.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 49158164: fix: don't recursively dispose primitives
8
+
3
9
  ## 8.15.9
4
10
 
5
11
  ### Patch Changes
@@ -139,7 +139,7 @@ function createRenderer(_roots, _getEventPriority) {
139
139
  // Since disposal is recursive, we can check the optional dispose arg, which will be undefined
140
140
  // when the reconciler calls it, but then carry our own check recursively
141
141
  const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
142
- const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose;
142
+ const shouldDispose = !isPrimitive && (dispose === undefined ? child.dispose !== null : dispose);
143
143
 
144
144
  // Remove nested child objects. Primitives should not have objects and children that are
145
145
  // attached to them declaratively ...
@@ -2143,7 +2143,9 @@ function Portal({
2143
2143
  },
2144
2144
  ...rest
2145
2145
  };
2146
- }, [state]);
2146
+ },
2147
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2148
+ [state]);
2147
2149
  const [usePortalStore] = React.useState(() => {
2148
2150
  // Create a mirrored store, based on the previous root with a few overrides ...
2149
2151
  const previousState = previousRoot.getState();
@@ -2184,9 +2186,11 @@ function Portal({
2184
2186
  unsub();
2185
2187
  usePortalStore.destroy();
2186
2188
  };
2189
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2187
2190
  }, []);
2188
2191
  React.useEffect(() => {
2189
2192
  usePortalStore.setState(injectState => inject(previousRoot.getState(), injectState));
2193
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2190
2194
  }, [inject]);
2191
2195
  return /*#__PURE__*/React.createElement(React.Fragment, null, reconciler.createPortal( /*#__PURE__*/React.createElement(context.Provider, {
2192
2196
  value: usePortalStore
@@ -166,7 +166,7 @@ function createRenderer(_roots, _getEventPriority) {
166
166
  // Since disposal is recursive, we can check the optional dispose arg, which will be undefined
167
167
  // when the reconciler calls it, but then carry our own check recursively
168
168
  const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
169
- const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose;
169
+ const shouldDispose = !isPrimitive && (dispose === undefined ? child.dispose !== null : dispose);
170
170
 
171
171
  // Remove nested child objects. Primitives should not have objects and children that are
172
172
  // attached to them declaratively ...
@@ -2170,7 +2170,9 @@ function Portal({
2170
2170
  },
2171
2171
  ...rest
2172
2172
  };
2173
- }, [state]);
2173
+ },
2174
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2175
+ [state]);
2174
2176
  const [usePortalStore] = React__namespace.useState(() => {
2175
2177
  // Create a mirrored store, based on the previous root with a few overrides ...
2176
2178
  const previousState = previousRoot.getState();
@@ -2211,9 +2213,11 @@ function Portal({
2211
2213
  unsub();
2212
2214
  usePortalStore.destroy();
2213
2215
  };
2216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2214
2217
  }, []);
2215
2218
  React__namespace.useEffect(() => {
2216
2219
  usePortalStore.setState(injectState => inject(previousRoot.getState(), injectState));
2220
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2217
2221
  }, [inject]);
2218
2222
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, reconciler.createPortal( /*#__PURE__*/React__namespace.createElement(context.Provider, {
2219
2223
  value: usePortalStore
@@ -166,7 +166,7 @@ function createRenderer(_roots, _getEventPriority) {
166
166
  // Since disposal is recursive, we can check the optional dispose arg, which will be undefined
167
167
  // when the reconciler calls it, but then carry our own check recursively
168
168
  const isPrimitive = (_child$__r3f5 = child.__r3f) == null ? void 0 : _child$__r3f5.primitive;
169
- const shouldDispose = dispose === undefined ? child.dispose !== null && !isPrimitive : dispose;
169
+ const shouldDispose = !isPrimitive && (dispose === undefined ? child.dispose !== null : dispose);
170
170
 
171
171
  // Remove nested child objects. Primitives should not have objects and children that are
172
172
  // attached to them declaratively ...
@@ -2170,7 +2170,9 @@ function Portal({
2170
2170
  },
2171
2171
  ...rest
2172
2172
  };
2173
- }, [state]);
2173
+ },
2174
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2175
+ [state]);
2174
2176
  const [usePortalStore] = React__namespace.useState(() => {
2175
2177
  // Create a mirrored store, based on the previous root with a few overrides ...
2176
2178
  const previousState = previousRoot.getState();
@@ -2211,9 +2213,11 @@ function Portal({
2211
2213
  unsub();
2212
2214
  usePortalStore.destroy();
2213
2215
  };
2216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2214
2217
  }, []);
2215
2218
  React__namespace.useEffect(() => {
2216
2219
  usePortalStore.setState(injectState => inject(previousRoot.getState(), injectState));
2220
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2217
2221
  }, [inject]);
2218
2222
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, reconciler.createPortal( /*#__PURE__*/React__namespace.createElement(context.Provider, {
2219
2223
  value: usePortalStore
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-d26c5c57.cjs.dev.js');
5
+ var index = require('./index-28e9146f.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-e6d64601.cjs.prod.js');
5
+ var index = require('./index-ae8ad041.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -1,5 +1,5 @@
1
- import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-594193f5.esm.js';
2
- export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-594193f5.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, a as useIsomorphicLayoutEffect, b as createRoot, i as isRef, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from './index-0c28a0fd.esm.js';
2
+ export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from './index-0c28a0fd.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';
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-d26c5c57.cjs.dev.js');
5
+ var index = require('../../dist/index-28e9146f.cjs.dev.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-e6d64601.cjs.prod.js');
5
+ var index = require('../../dist/index-ae8ad041.cjs.prod.js');
6
6
  var _extends = require('@babel/runtime/helpers/extends');
7
7
  var React = require('react');
8
8
  var THREE = require('three');
@@ -1,5 +1,5 @@
1
- import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-594193f5.esm.js';
2
- export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-594193f5.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, b as createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-0c28a0fd.esm.js';
2
+ export { t as ReactThreeFiber, x as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, w as buildGraph, f as context, c as createEvents, g as createPortal, b as createRoot, k as dispose, e as extend, q as flushGlobalEffects, s as getRootState, l as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, C as useFrame, D as useGraph, y as useInstanceHandle, F as useLoader, z as useStore, A as useThree } from '../../dist/index-0c28a0fd.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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/fiber",
3
- "version": "8.15.9",
3
+ "version": "8.15.10",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",