@daily-co/daily-react
Version:
Daily React makes it easier to integrate [@daily-co/daily-js](https://www.npmjs.com/package/@daily-co/daily-js) in React applications.
17 lines (14 loc) • 677 B
text/typescript
import { useAtomValue } from 'jotai';
import { useDebugValue } from 'react';
import { localIdState } from '../DailyParticipants';
import { useParticipant } from './useParticipant';
/**
* Returns the [participants() object](https://docs.daily.co/reference/daily-js/instance-methods/participants) for the local user.
* @deprecated Use [useLocalSessionId](https://docs.daily.co/reference/daily-react/use-local-session-id) instead.
*/
export const useLocalParticipant = (): ReturnType<typeof useParticipant> => {
const localId = useAtomValue(localIdState);
const localParticipant = useParticipant(localId);
useDebugValue(localParticipant);
return localParticipant;
};