@react-three/fiber 8.9.1 → 8.9.2
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 +6 -0
- package/dist/declarations/src/core/renderer.d.ts +1 -0
- package/dist/declarations/src/three-types.d.ts +1 -1
- package/dist/{index-57cb2f85.cjs.prod.js → index-25dfa84d.cjs.prod.js} +9 -1
- package/dist/{index-6f0019d1.esm.js → index-79f9c7e9.esm.js} +9 -1
- package/dist/{index-8539ced2.cjs.dev.js → index-efc69a1d.cjs.dev.js} +9 -1
- package/dist/react-three-fiber.cjs.dev.js +1 -1
- package/dist/react-three-fiber.cjs.prod.js +1 -1
- package/dist/react-three-fiber.esm.js +2 -2
- package/native/dist/react-three-fiber-native.cjs.dev.js +1 -1
- package/native/dist/react-three-fiber-native.cjs.prod.js +1 -1
- package/native/dist/react-three-fiber-native.esm.js +2 -2
- package/package.json +1 -1
- package/readme.md +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -21,6 +21,7 @@ export declare type LocalState = {
|
|
|
21
21
|
memoizedProps: {
|
|
22
22
|
[key: string]: any;
|
|
23
23
|
};
|
|
24
|
+
autoRemovedBeforeAppend?: boolean;
|
|
24
25
|
};
|
|
25
26
|
export declare type AttachFnType = (parent: Instance, self: Instance) => () => void;
|
|
26
27
|
export declare type AttachType = string | AttachFnType;
|
|
@@ -126,7 +126,7 @@ export declare type MeshMatcapMaterialProps = MaterialNode<THREE.MeshMatcapMater
|
|
|
126
126
|
export declare type LineDashedMaterialProps = MaterialNode<THREE.LineDashedMaterial, [THREE.LineDashedMaterialParameters]>;
|
|
127
127
|
export declare type LineBasicMaterialProps = MaterialNode<THREE.LineBasicMaterial, [THREE.LineBasicMaterialParameters]>;
|
|
128
128
|
export declare type PrimitiveProps = {
|
|
129
|
-
object:
|
|
129
|
+
object: object;
|
|
130
130
|
} & {
|
|
131
131
|
[properties: string]: any;
|
|
132
132
|
};
|
|
@@ -1077,7 +1077,15 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1077
1077
|
instance.__r3f.objects.forEach(child => appendChild(newInstance, child));
|
|
1078
1078
|
|
|
1079
1079
|
instance.__r3f.objects = [];
|
|
1080
|
-
|
|
1080
|
+
|
|
1081
|
+
if (!instance.__r3f.autoRemovedBeforeAppend) {
|
|
1082
|
+
removeChild(parent, instance);
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
if (newInstance.parent) {
|
|
1086
|
+
newInstance.__r3f.autoRemovedBeforeAppend = true;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1081
1089
|
appendChild(parent, newInstance); // Re-bind event handlers
|
|
1082
1090
|
|
|
1083
1091
|
if (newInstance.raycast && newInstance.__r3f.eventCount) {
|
|
@@ -1050,7 +1050,15 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1050
1050
|
instance.__r3f.objects.forEach(child => appendChild(newInstance, child));
|
|
1051
1051
|
|
|
1052
1052
|
instance.__r3f.objects = [];
|
|
1053
|
-
|
|
1053
|
+
|
|
1054
|
+
if (!instance.__r3f.autoRemovedBeforeAppend) {
|
|
1055
|
+
removeChild(parent, instance);
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
if (newInstance.parent) {
|
|
1059
|
+
newInstance.__r3f.autoRemovedBeforeAppend = true;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1054
1062
|
appendChild(parent, newInstance); // Re-bind event handlers
|
|
1055
1063
|
|
|
1056
1064
|
if (newInstance.raycast && newInstance.__r3f.eventCount) {
|
|
@@ -1077,7 +1077,15 @@ function createRenderer(_roots, _getEventPriority) {
|
|
|
1077
1077
|
instance.__r3f.objects.forEach(child => appendChild(newInstance, child));
|
|
1078
1078
|
|
|
1079
1079
|
instance.__r3f.objects = [];
|
|
1080
|
-
|
|
1080
|
+
|
|
1081
|
+
if (!instance.__r3f.autoRemovedBeforeAppend) {
|
|
1082
|
+
removeChild(parent, instance);
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
if (newInstance.parent) {
|
|
1086
|
+
newInstance.__r3f.autoRemovedBeforeAppend = true;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1081
1089
|
appendChild(parent, newInstance); // Re-bind event handlers
|
|
1082
1090
|
|
|
1083
1091
|
if (newInstance.raycast && newInstance.__r3f.eventCount) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var index = require('./index-
|
|
5
|
+
var index = require('./index-efc69a1d.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-
|
|
5
|
+
var index = require('./index-25dfa84d.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, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-
|
|
2
|
-
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a 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, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-
|
|
1
|
+
import { c as createEvents, e as extend, u as useMutableCallback, a as createRoot, i as isRef, E as ErrorBoundary, B as Block, b as useIsomorphicLayoutEffect, d as unmountComponentAtNode } from './index-79f9c7e9.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a 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, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from './index-79f9c7e9.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-
|
|
5
|
+
var index = require('../../dist/index-efc69a1d.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-
|
|
5
|
+
var index = require('../../dist/index-25dfa84d.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-
|
|
2
|
-
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a 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, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-
|
|
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-79f9c7e9.esm.js';
|
|
2
|
+
export { t as ReactThreeFiber, w as _roots, v as act, o as addAfterEffect, n as addEffect, p as addTail, m as advance, j as applyProps, f as context, c as createEvents, g as createPortal, a 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, A as useFrame, C as useGraph, x as useInstanceHandle, D as useLoader, y as useStore, z as useThree } from '../../dist/index-79f9c7e9.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
package/readme.md
CHANGED
|
@@ -55,7 +55,7 @@ function Box(props) {
|
|
|
55
55
|
const [hovered, hover] = useState(false)
|
|
56
56
|
const [clicked, click] = useState(false)
|
|
57
57
|
// Subscribe this component to the render-loop, rotate the mesh every frame
|
|
58
|
-
useFrame((state, delta) => (ref.current.rotation.x +=
|
|
58
|
+
useFrame((state, delta) => (ref.current.rotation.x += delta))
|
|
59
59
|
// Return the view, these are regular Threejs elements expressed in JSX
|
|
60
60
|
return (
|
|
61
61
|
<mesh
|
|
@@ -98,7 +98,7 @@ function Box(props: ThreeElements['mesh']) {
|
|
|
98
98
|
const ref = useRef<THREE.Mesh>(null!)
|
|
99
99
|
const [hovered, hover] = useState(false)
|
|
100
100
|
const [clicked, click] = useState(false)
|
|
101
|
-
useFrame((state, delta) => (ref.current.rotation.x +=
|
|
101
|
+
useFrame((state, delta) => (ref.current.rotation.x += delta))
|
|
102
102
|
return (
|
|
103
103
|
<mesh
|
|
104
104
|
{...props}
|
|
@@ -163,7 +163,7 @@ function Box(props) {
|
|
|
163
163
|
const mesh = useRef(null)
|
|
164
164
|
const [hovered, setHover] = useState(false)
|
|
165
165
|
const [active, setActive] = useState(false)
|
|
166
|
-
useFrame((state, delta) => (mesh.current.rotation.x +=
|
|
166
|
+
useFrame((state, delta) => (mesh.current.rotation.x += delta))
|
|
167
167
|
return (
|
|
168
168
|
<mesh
|
|
169
169
|
{...props}
|