Hook to get the reactions of a specific stream.

Imports

import { useReactions } from '@river-build/react-sdk'

Definition

function useReactions(
  streamId: string,
  config?: ObservableConfig.FromData<ReactionsMap>,
): {
    data: ReactionsMap;
    error: undefined;
    status: "loading" | "loaded";
    isLoading: boolean;
    isError: false;
    isLoaded: boolean;
}

Source: useReactions

Parameters

streamId

  • Type: string

The id of the stream to get the reactions of.

config

  • Type: ObservableConfig.FromData<ReactionsMap>
  • Optional

Configuration options for the observable.

Return Type

The reactions of the stream as a map from the message eventId to the reaction.

{
    data: ReactionsMap;
    error: undefined;
    status: "loading" | "loaded";
    isLoading: boolean;
    isError: false;
    isLoaded: boolean;
}