Skip to main content
Deprecated 0.17.0 useParticipant(params): Object | null If no participant is found for the given session_id, returns null. useParticipant can also be used to set up optional callbacks for participant-left and participant-updated events.

Parameters

session_id
string
required
A unique identifier for the participant
onParticipantLeft
Function
Callback for the participant-left event
onParticipantUpdated
Function
Callback for the participant-updated event

Return value

Returns an Object | null containing detailed information about the participant. See participant properties. If no participant is found for a given session_id, useParticipant returns null.

Example

import { useParticipant } from '@daily-co/daily-react';

export const UseParticipantDemo = (params) => {
  const sessionID = params.session_id;
  const participant = useParticipant(sessionID);

  return <div>Participant {participant ? 'found' : 'not found'}</div>;
};

See also