@ably/chat - v1.1.1
    Preparing search index...

    Interface ChatRoomProviderProps

    Props for the ChatRoomProvider component.

    interface ChatRoomProviderProps {
        children?: ReactNode | ReactNode[];
        name: string;
        options?: RoomOptions;
    }
    Index

    Properties

    children?: ReactNode | ReactNode[]

    Children nodes.

    name: string

    The name of the room.

    options?: RoomOptions

    Overriding options to use when creating the room. See RoomOptions for details.

    Important:

    • The options should be memoized to prevent unnecessary room recreations. Passing a new object reference on each render will cause the room to be released and recreated.
    • Provided options are merged with the default options, so you only need to specify the options you want to change.
    • Room options cannot be changed after the room is created. Different options for the same room name will result in an error.
    const MyRoomComponent = () => {
    const [typing, setTyping] = useState(true);

    const roomOptions = useMemo(() => ({
    typing: { timeoutMs: 5000 },
    }), []); // Stable reference - options don't change

    return (
    <ChatRoomProvider name="my-room" options={roomOptions}>
    <MyChat />
    </ChatRoomProvider>
    );
    };