Skip to content

Commit

Permalink
fix: mf-5994 check if ValueRef is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleBill committed Jan 18, 2024
1 parent d989f14 commit f65ef7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared-base-ui/src/hooks/useValueRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getServerSnapshot(): never {
export function useValueRef<T>(ref: ValueRef<T>): T {
if ('readyPromise' in ref) {
const ref2 = ref as ValueRefWithReady<T>
if (!ref2.nowReady) use(ref2.readyPromise)
if (!ref2.ready) use(ref2.readyPromise)
}
return useSyncExternalStore(
(f) => ref.addListener(f),
Expand Down

0 comments on commit f65ef7e

Please sign in to comment.