Optional
attachSet to false
to disable auto-attaching the room when component mounts
and auto-detaching when it unmounts.
If set to false
, you must manually attach and detach the room using
room.attach()
and room.detach()
or the provided shortcut functions
that useRoom provides.
Setting this flag to false
is useful in the case where you have more providers for the same room,
and you need to control the attachment manually or by choosing which provider handles it.
Optional
childrenChildren nodes.
The id of the room.
The options to use when creating the room. A convenient default value is provided by RoomOptionsDefaults, but it must explicitly be set here.
RoomOptionsDefaults can also be used partially, for example:
<ChatRoomProvider id="room-id" options={{
presence: RoomOptionsDefaults.presence,
reactions: RoomOptionsDefaults.reactions,
}} />
NOTE: This value is not memoized by the provider. It must be memoized in your component to prevent re-renders of a parent component from causing the room to be recreated.
Optional
releaseSet to false
to disable auto-releasing the room when component unmounts,
to support multiple ChatRoomProviders for the same room.
If set to false
, you must manually release the room using
chatClient.rooms.release(id)
or have another ChatRoomProvider for
the same room and release set to true
.
Props for the ChatRoomProvider component.