@react-three/fiber 8.0.18 → 8.0.19

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.0.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 360b45a: fix: handle attach on reconstruct
8
+
3
9
  ## 8.0.18
4
10
 
5
11
  ### Patch Changes
@@ -1002,7 +1002,7 @@ function createRenderer(roots, getEventPriority) {
1002
1002
  }
1003
1003
 
1004
1004
  function switchInstance(instance, type, newProps, fiber) {
1005
- var _instance$__r3f, _instance$__r3f2;
1005
+ var _instance$__r3f, _instance$__r3f2, _newInstance$__r3f;
1006
1006
 
1007
1007
  const parent = (_instance$__r3f = instance.__r3f) == null ? void 0 : _instance$__r3f.parent;
1008
1008
  if (!parent) return;
@@ -1026,6 +1026,11 @@ function createRenderer(roots, getEventPriority) {
1026
1026
  const rootState = newInstance.__r3f.root.getState();
1027
1027
 
1028
1028
  rootState.internal.interaction.push(newInstance);
1029
+ } // The attach attribute implies that the object attaches itself on the parent
1030
+
1031
+
1032
+ if ((_newInstance$__r3f = newInstance.__r3f) != null && _newInstance$__r3f.attach) {
1033
+ attach(parent, newInstance, newInstance.__r3f.attach);
1029
1034
  } // This evil hack switches the react-internal fiber node
1030
1035
  [fiber, fiber.alternate].forEach(fiber => {
1031
1036
  if (fiber !== null) {
@@ -1029,7 +1029,7 @@ function createRenderer(roots, getEventPriority) {
1029
1029
  }
1030
1030
 
1031
1031
  function switchInstance(instance, type, newProps, fiber) {
1032
- var _instance$__r3f, _instance$__r3f2;
1032
+ var _instance$__r3f, _instance$__r3f2, _newInstance$__r3f;
1033
1033
 
1034
1034
  const parent = (_instance$__r3f = instance.__r3f) == null ? void 0 : _instance$__r3f.parent;
1035
1035
  if (!parent) return;
@@ -1053,6 +1053,11 @@ function createRenderer(roots, getEventPriority) {
1053
1053
  const rootState = newInstance.__r3f.root.getState();
1054
1054
 
1055
1055
  rootState.internal.interaction.push(newInstance);
1056
+ } // The attach attribute implies that the object attaches itself on the parent
1057
+
1058
+
1059
+ if ((_newInstance$__r3f = newInstance.__r3f) != null && _newInstance$__r3f.attach) {
1060
+ attach(parent, newInstance, newInstance.__r3f.attach);
1056
1061
  } // This evil hack switches the react-internal fiber node
1057
1062
  [fiber, fiber.alternate].forEach(fiber => {
1058
1063
  if (fiber !== null) {
@@ -1029,7 +1029,7 @@ function createRenderer(roots, getEventPriority) {
1029
1029
  }
1030
1030
 
1031
1031
  function switchInstance(instance, type, newProps, fiber) {
1032
- var _instance$__r3f, _instance$__r3f2;
1032
+ var _instance$__r3f, _instance$__r3f2, _newInstance$__r3f;
1033
1033
 
1034
1034
  const parent = (_instance$__r3f = instance.__r3f) == null ? void 0 : _instance$__r3f.parent;
1035
1035
  if (!parent) return;
@@ -1053,6 +1053,11 @@ function createRenderer(roots, getEventPriority) {
1053
1053
  const rootState = newInstance.__r3f.root.getState();
1054
1054
 
1055
1055
  rootState.internal.interaction.push(newInstance);
1056
+ } // The attach attribute implies that the object attaches itself on the parent
1057
+
1058
+
1059
+ if ((_newInstance$__r3f = newInstance.__r3f) != null && _newInstance$__r3f.attach) {
1060
+ attach(parent, newInstance, newInstance.__r3f.attach);
1056
1061
  } // This evil hack switches the react-internal fiber node
1057
1062
  [fiber, fiber.alternate].forEach(fiber => {
1058
1063
  if (fiber !== null) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('./index-c937c162.cjs.dev.js');
5
+ var index = require('./index-88f08658.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-e2e71da1.cjs.prod.js');
5
+ var index = require('./index-dcd9befe.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 createRoot, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-acedf326.esm.js';
2
- export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from './index-acedf326.esm.js';
1
+ import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-1e2a4313.esm.js';
2
+ export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from './index-1e2a4313.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-c937c162.cjs.dev.js');
5
+ var index = require('../../dist/index-88f08658.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-e2e71da1.cjs.prod.js');
5
+ var index = require('../../dist/index-dcd9befe.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 createRoot, E as ErrorBoundary, B as Block, d as unmountComponentAtNode } from '../../dist/index-acedf326.esm.js';
2
- export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from '../../dist/index-acedf326.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-1e2a4313.esm.js';
2
+ export { t as ReactThreeFiber, s as _roots, q as act, n as addAfterEffect, m as addEffect, o as addTail, l as advance, i as applyProps, f as context, g as createPortal, a as createRoot, j as dispose, e as extend, p as getRootState, k as invalidate, h as reconciler, r as render, d as unmountComponentAtNode, x as useFrame, y as useGraph, z as useLoader, v as useStore, w as useThree } from '../../dist/index-1e2a4313.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.0.18",
3
+ "version": "8.0.19",
4
4
  "description": "A React renderer for Threejs",
5
5
  "keywords": [
6
6
  "react",