OptionalchildrenChildren nodes.
The name of the room.
OptionaloptionsOverriding options to use when creating the room. See RoomOptions for details.
Important:
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.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>
);
};
Props for the ChatRoomProvider component.