diff --git a/src/react/utils/useProxy.ts b/src/react/utils/useProxy.ts index df617ee4..73acf44b 100644 --- a/src/react/utils/useProxy.ts +++ b/src/react/utils/useProxy.ts @@ -1,6 +1,8 @@ import { useLayoutEffect } from 'react' import { useSnapshot } from '../../react.ts' +const DUMMY_SYMBOL = Symbol() + /** * useProxy * @@ -28,8 +30,10 @@ export function useProxy( ): T { const snapshot = useSnapshot(proxy, options) as T - let isRendering = true + // touch dummy prop so that it doesn't trigger re-renders when no props are touched. + ;(snapshot as any)[DUMMY_SYMBOL] + let isRendering = true useLayoutEffect(() => { // This is an intentional hack // eslint-disable-next-line react-hooks/exhaustive-deps