yuustate 3.11.2 → 3.11.3
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/esm/react.mjs +2 -2
- package/package.json +1 -1
- package/react.js +1 -1
package/esm/react.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useLayoutEffect, useEffect, useRef, useSyncExternalStore, useCallback, useMemo, useState } from 'react';
|
|
1
|
+
import { useLayoutEffect, useEffect, useRef, useSyncExternalStore, useCallback, useMemo, isValidElement, useState } from 'react';
|
|
2
2
|
import { isClient, initStore, getHash, noop } from 'yuustate/vanilla';
|
|
3
3
|
|
|
4
4
|
const useIsomorphicLayoutEffect = isClient ? useLayoutEffect : useEffect;
|
|
@@ -36,7 +36,7 @@ const useStoreStateProxy = (storeState) => {
|
|
|
36
36
|
const track = (path) => usedPathsRef.current.push(path);
|
|
37
37
|
const proxyCache = /* @__PURE__ */ new WeakMap();
|
|
38
38
|
const createDeepProxy = (target, path = []) => {
|
|
39
|
-
if (typeof target !== "object" || target === null) {
|
|
39
|
+
if (typeof target !== "object" || target === null || isValidElement(target)) {
|
|
40
40
|
return target;
|
|
41
41
|
}
|
|
42
42
|
if (proxyCache.has(target)) {
|
package/package.json
CHANGED
package/react.js
CHANGED
|
@@ -38,7 +38,7 @@ const useStoreStateProxy = (storeState) => {
|
|
|
38
38
|
const track = (path) => usedPathsRef.current.push(path);
|
|
39
39
|
const proxyCache = /* @__PURE__ */ new WeakMap();
|
|
40
40
|
const createDeepProxy = (target, path = []) => {
|
|
41
|
-
if (typeof target !== "object" || target === null) {
|
|
41
|
+
if (typeof target !== "object" || target === null || react.isValidElement(target)) {
|
|
42
42
|
return target;
|
|
43
43
|
}
|
|
44
44
|
if (proxyCache.has(target)) {
|