Skip to content

Commit

Permalink
Merge branch 'main' into feat/support-watch-promise
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Nov 28, 2023
2 parents 237b722 + 01672d9 commit 554fc73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/react/utils/useProxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { useLayoutEffect } from 'react'
import { useSnapshot } from '../../react.ts'

const DUMMY_SYMBOL = Symbol()

/**
* useProxy
*
Expand Down Expand Up @@ -28,8 +30,10 @@ export function useProxy<T extends object>(
): 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
Expand Down

0 comments on commit 554fc73

Please sign in to comment.