Skip to content

Conversation

@1egoman
Copy link
Contributor

@1egoman 1egoman commented Aug 11, 2025

Per @lukasIO's and my discussion, adds a hook that can be used to work around useEffects not waiting for a room.disconnect() to finish in the cleanup function before running a room.connect().

I tested it out in agent-starter-embed and it seemed to do what was expected.

@changeset-bot
Copy link

changeset-bot bot commented Aug 11, 2025

🦋 Changeset detected

Latest commit: 67e41a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@livekit/components-react Patch
@livekit/component-example-next Patch
@livekit/components-js-docs Patch
@livekit/component-docs-storybook Patch
@livekit/components-docs-gen Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 11, 2025

size-limit report 📦

Path Size
LiveKitRoom only 6 KB (0%)
LiveKitRoom with VideoConference 30.59 KB (0%)
All exports 38.59 KB (+1.2% 🔺)

@1egoman 1egoman requested a review from lukasIO August 11, 2025 18:43
*
* @public
*/
export function useSequentialRoomConnectDisconnect(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a very descriptive name.
Definitely can see why you chose the name, but if you can think of something a bit more concise I wouldn't mind 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a really hard one to name... that one was the best I could come up with. I'll keep pondering it but definitely open to suggestions!

@1egoman 1egoman force-pushed the add-room-connect-disconnect-hack branch 6 times, most recently from de6e0dc to 1b81b55 Compare August 12, 2025 15:42
@1egoman 1egoman force-pushed the add-room-connect-disconnect-hack branch from 1b81b55 to 67e41a3 Compare August 12, 2025 15:50
@1egoman 1egoman requested a review from lukasIO August 12, 2025 16:00
@1egoman 1egoman merged commit d343373 into main Aug 14, 2025
6 checks passed
@1egoman 1egoman deleted the add-room-connect-disconnect-hack branch August 14, 2025 14:21
@github-actions github-actions bot mentioned this pull request Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants