@react-three/test-renderer 8.0.12 → 8.0.15

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,29 @@
1
1
  # @react-three/test-renderer
2
2
 
3
+ ## 8.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - b7cd0f42: update viewport on camera changes
8
+ - Updated dependencies [b7cd0f42]
9
+ - @react-three/fiber@8.0.25
10
+
11
+ ## 8.0.14
12
+
13
+ ### Patch Changes
14
+
15
+ - 29d03c64: revert multi attach
16
+ - Updated dependencies [29d03c64]
17
+ - @react-three/fiber@8.0.23
18
+
19
+ ## 8.0.13
20
+
21
+ ### Patch Changes
22
+
23
+ - 4c87bce: fix: attach, devtools, and perf fixes
24
+ - Updated dependencies [4c87bce]
25
+ - @react-three/fiber@8.0.20
26
+
3
27
  ## 8.0.12
4
28
 
5
29
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  import * as THREE from 'three';
2
- import { UseStore } from 'zustand';
2
+ import { UseBoundStore } from 'zustand';
3
3
  import type { BaseInstance, LocalState, RootState } from '@react-three/fiber';
4
- export declare type MockUseStoreState = UseStore<RootState>;
4
+ export declare type MockUseStoreState = UseBoundStore<RootState>;
5
5
  export interface MockInstance extends Omit<BaseInstance, '__r3f'> {
6
6
  __r3f: Omit<LocalState, 'root' | 'objects' | 'parent'> & {
7
7
  root: MockUseStoreState;
@@ -688,22 +688,24 @@ const create = async (element, options) => {
688
688
 
689
689
  // this is our root
690
690
  const fiber$1 = (_mockRoots$get = fiber._roots.get(_fiber)) == null ? void 0 : _mockRoots$get.fiber;
691
- const root = {
692
- /**
693
- * we wrap our child in a Provider component
694
- * and context.Provider, so do a little
695
- * artificial dive to get round this and
696
- * pass context.Provider as if it was the
697
- * actual react root
698
- */
699
- current: fiber$1.current.child.child
700
- };
701
-
702
- if (fiber$1.current.child.child) {
691
+ const current = fiber$1 == null ? void 0 : fiber$1.current.child.child;
692
+
693
+ if (current) {
694
+ const root = {
695
+ /**
696
+ * we wrap our child in a Provider component
697
+ * and context.Provider, so do a little
698
+ * artificial dive to get round this and
699
+ * pass context.Provider as if it was the
700
+ * actual react root
701
+ */
702
+ current
703
+ };
703
704
  /**
704
705
  * so this actually returns the instance
705
706
  * the user has passed through as a Fiber
706
707
  */
708
+
707
709
  return fiber.reconciler.getPublicRootInstance(root);
708
710
  } else {
709
711
  return null;
@@ -688,22 +688,24 @@ const create = async (element, options) => {
688
688
 
689
689
  // this is our root
690
690
  const fiber$1 = (_mockRoots$get = fiber._roots.get(_fiber)) == null ? void 0 : _mockRoots$get.fiber;
691
- const root = {
692
- /**
693
- * we wrap our child in a Provider component
694
- * and context.Provider, so do a little
695
- * artificial dive to get round this and
696
- * pass context.Provider as if it was the
697
- * actual react root
698
- */
699
- current: fiber$1.current.child.child
700
- };
701
-
702
- if (fiber$1.current.child.child) {
691
+ const current = fiber$1 == null ? void 0 : fiber$1.current.child.child;
692
+
693
+ if (current) {
694
+ const root = {
695
+ /**
696
+ * we wrap our child in a Provider component
697
+ * and context.Provider, so do a little
698
+ * artificial dive to get round this and
699
+ * pass context.Provider as if it was the
700
+ * actual react root
701
+ */
702
+ current
703
+ };
703
704
  /**
704
705
  * so this actually returns the instance
705
706
  * the user has passed through as a Fiber
706
707
  */
708
+
707
709
  return fiber.reconciler.getPublicRootInstance(root);
708
710
  } else {
709
711
  return null;
@@ -664,22 +664,24 @@ const create = async (element, options) => {
664
664
 
665
665
  // this is our root
666
666
  const fiber = (_mockRoots$get = _roots.get(_fiber)) == null ? void 0 : _mockRoots$get.fiber;
667
- const root = {
668
- /**
669
- * we wrap our child in a Provider component
670
- * and context.Provider, so do a little
671
- * artificial dive to get round this and
672
- * pass context.Provider as if it was the
673
- * actual react root
674
- */
675
- current: fiber.current.child.child
676
- };
677
-
678
- if (fiber.current.child.child) {
667
+ const current = fiber == null ? void 0 : fiber.current.child.child;
668
+
669
+ if (current) {
670
+ const root = {
671
+ /**
672
+ * we wrap our child in a Provider component
673
+ * and context.Provider, so do a little
674
+ * artificial dive to get round this and
675
+ * pass context.Provider as if it was the
676
+ * actual react root
677
+ */
678
+ current
679
+ };
679
680
  /**
680
681
  * so this actually returns the instance
681
682
  * the user has passed through as a Fiber
682
683
  */
684
+
683
685
  return reconciler.getPublicRootInstance(root);
684
686
  } else {
685
687
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/test-renderer",
3
- "version": "8.0.12",
3
+ "version": "8.0.15",
4
4
  "description": "Test Renderer for react-three-fiber",
5
5
  "author": "Josh Ellis",
6
6
  "license": "MIT",
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "react": ">=17.0",
26
- "@react-three/fiber": ">=8.0.15",
26
+ "@react-three/fiber": ">=8.0.25",
27
27
  "three": ">=0.126"
28
28
  }
29
29
  }