diff --git a/src/react.ts b/src/react.ts index ec7077ca..c219da16 100644 --- a/src/react.ts +++ b/src/react.ts @@ -110,8 +110,9 @@ export function useSnapshot( options?: Options, ): Snapshot { const notifyInSync = options?.sync - // per-hook affected, it's not ideal but memo compatible - const affected = useMemo(() => new WeakMap(), []) + // per-proxy & per-hook affected, it's not ideal but memo compatible + // eslint-disable-next-line react-hooks/exhaustive-deps + const affected = useMemo(() => new WeakMap(), [proxyObject]) const lastSnapshot = useRef>() let inRender = true const currSnapshot = useSyncExternalStore(