Skip to content

Commit 092facb

Browse files
committed
fix: remove prepareConnection dependency in useEffect
This was causing prepareConnection to get run constantly since its reference depends on restOptions which changes every call. The way I see it, if a user is changing their options and wants prepareconnection to be run for something beyond the initial set (probably unusual), they can call it themselves on the returned session object.
1 parent f3ab908 commit 092facb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/src/hooks/useSession.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ export function useSession(
491491
// FIXME: figure out a better logging solution?
492492
console.warn('WARNING: Room.prepareConnection failed:', err);
493493
});
494-
}, [prepareConnection]);
494+
}, [/* note: no prepareConnection here, this effect should only ever run once! */]);
495495

496496
return React.useMemo(
497497
() => ({

0 commit comments

Comments
 (0)