-
-
Save vrajdesai78/e82fc415d6f8d0dc581deb4d3f266b6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useHuddle01 } from '@huddle01/react'; | |
import { useLobby } from '@huddle01/react/hooks'; | |
const App = () => { | |
const { initialize, isInitialized } = useHuddle01(); | |
const { joinLobby } = useLobby(); | |
useEffect(() => { | |
// its preferable to use env vars to store projectId | |
initialize('YOUR_PROJECT_ID'); | |
}, []); | |
return ( | |
<div>{isInitialized ? 'Hello World!' : 'Please initialize'} | |
<button | |
disabled={joinLobby.isCallable} | |
onClick={() => joinLobby('YOUR_ROOM_ID'); | |
}> | |
Join Lobby | |
</button> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment