BreakoutRoomsModal - Breakout room creation and management interface

BreakoutRoomsModal is a React Native component that provides hosts with controls to create multiple breakout rooms, assign participants to rooms, and manage the breakout session lifecycle (start/stop). Participants can be manually assigned or randomly distributed across rooms.

Key Features:

  • Create multiple breakout rooms (customizable count)
  • Manual participant assignment to rooms
  • Random participant distribution option
  • Edit room assignments (add/remove participants)
  • Duplicate participant prevention
  • Start/stop breakout session controls
  • Real-time Socket.io synchronization
  • Display mode switching for breakout view
  • Validation for starting (all participants assigned)

UI Customization: This component can be replaced via uiOverrides.breakoutRoomsModal to provide a completely custom breakout room management interface.

// Basic usage with manual assignment
import React, { useState } from 'react';
import { BreakoutRoomsModal } from 'mediasfu-reactnative-expo';
import { io } from 'socket.io-client';

const socket = io('https://your-server.com');
const [showBreakout, setShowBreakout] = useState(false);

const breakoutParams = {
participants: [
{ name: 'John', id: '1', islevel: '0' },
{ name: 'Jane', id: '2', islevel: '0' },
{ name: 'Bob', id: '3', islevel: '0' },
],
breakoutRooms: [[], []], // 2 empty rooms
breakOutRoomStarted: false,
breakOutRoomEnded: false,
currentRoomIndex: null,
canStartBreakout: false,
roomName: 'main-meeting',
socket: socket,
updateBreakoutRooms: (rooms) => console.log('Updated:', rooms),
updateBreakOutRoomStarted: (started) => console.log('Started:', started),
// ... other required parameters
};

return (
<BreakoutRoomsModal
isVisible={showBreakout}
onBreakoutRoomsClose={() => setShowBreakout(false)}
parameters={breakoutParams}
/>
);
// With random assignment and custom positioning
return (
<BreakoutRoomsModal
isVisible={isVisible}
onBreakoutRoomsClose={handleClose}
parameters={breakoutParameters}
position="center"
backgroundColor="#2c3e50"
/>
);
// Using custom UI via uiOverrides
const config = {
uiOverrides: {
breakoutRoomsModal: {
component: MyCustomBreakoutManager,
injectedProps: {
theme: 'dark',
allowAutoAssign: true,
},
},
},
};

return <MyMeetingComponent config={config} />;

Properties

propTypes?: WeakValidationMap<BreakoutRoomsModalOptions>

Used to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.

We recommend using TypeScript instead of checking prop types at runtime.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<BreakoutRoomsModalOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'