This message was deleted.
# helpdesk
s
This message was deleted.
p
useRoom
itself doesn’t connect. the `useRoom`only returns the
connect
function among other things.
the
startAudio
error is due to browser policies, there’s a static method on
Room
to manually call startAudio after a user gesture: https://docs.livekit.io/client-sdk-js/classes/Room.html#startAudio
Maybe the lock up you are seeing is connected to room being potentially undefined on first render in the latest version, can you double check that? This was a recent change in order to fix auto-disconnects (related PR https://github.com/livekit/livekit-react/pull/112)
b
I’m guessing here, but I think room was undefined with 0.6.2 but with the latest it’s being defined but the state is disconnected and then room name is blank. So maybe this is the difference? I can change my code because a lot of it was based on room being undefined.
So yes, to answer your question. It’s undefined and then gets defined. I didn’t check for this at the beginning. I really should have. It was only when I decided to comment out a lot of the code and leave the useRoom, that I found out the root cause.
🙌 1
@polite-kilobyte-67570 I decided to refactor code similar to the example provided. Where all the logic is in it’s own component and initialised when I pass a token to it. It now behaves a lot better than before. One question I have now. 1.1.0 vs 1.0.3. With 1.0.3 is no problem at all. I can connect and disconnect and the microphone seems to work, I get the recording notification in the tab. Seems fine. 1.1.0. I get room is not ready yet and it does not connect. Same code. Did anything change significantly between 1.0.3 and 1.1.0? Thanks
I can put my code in a gist if that’s helpful.