Function useRemoteUsers

  • This hook lets you retrieve the list of remote users. The return value of this hook is updated in the following cases: When a remote user joins or leaves the channel. When the role of a remote user changes (for example, from broadcaster to audience). When a remote user publishes or unpublishes the audio or video track.

    Parameters

    Returns IAgoraRTCRemoteUser[]

    Example

    import { useRemoteUsers } from "agora-rtc-react";

    function App() {
    const remoteUsers = useRemoteUsers();

    return <></>;
    }