PreJoin
function PreJoin(__namedParameters): Element;Defined in: packages/react/src/components/PreJoin.tsx:72
The PreJoin prefab component is normally presented to the user before he enters a room. This component allows the user to check and select the preferred media device (camera and microphone). On submit the user decisions
Parameters
| Parameter | Type |
|---|---|
__namedParameters | PreJoinProps |
Returns
Element
Example
// Basic — show the default pre-join form.
<PreJoin />
// Advanced — validate choices before connecting to the room.
function JoinFlow() {
const [choices, setChoices] = React.useState<LocalUserChoices>();
return choices ? (
<VoiceRoom agent={agent}>
) : (
<PreJoin
defaults={savedChoices}
onValidate={validateChoices}
onSubmit={setChoices}
onError={setJoinError}
/>
);
}