Skip to content

Pin React/React-DOM version to 18.3.1 #40

@Arthurk12

Description

@Arthurk12

Describe the bug
The @mconf/bbb-ui-components-react library has its own node_modules/ with React 19.1.1, while the main BigBlueButton HTML5 project uses React 18.3.1. This version mismatch causes multiple instances of React to be loaded, breaking React Hooks functionality.

To Reproduce
Steps to reproduce the behavior:

  1. Install @mconf/bbb-ui-components-react as a local dependency in bigbluebutton-html5
  2. Use any component from the library that includes hooks (e.g., BBBModal)
  3. Join a meeting
  4. Interact with the component or open any view that uses the library

Expected behavior
The component should render without errors and React Hooks should work correctly.

Actual behavior
The following error appears in the console:

Uncaught TypeError: Cannot read properties of null (reading 'useState')
    at exports.useState (react.development.js:1222:1)
    at <component_name>

BBB version, plugin in which the bug happened and SDK version:
dev40

Additional context
The error occurs because the component library imports React 19.1.1 from its own node_modules/, while the main project expects React 18.3.1. This breaks React's Hook system, which relies on a single instance of React.

Solution:
Pin the React version in @mconf/bbb-ui-components-react to 18.3.1 to match bigbluebutton-html5:

Update peerDependencies: "react": "18.3.1" and "react-dom": "18.3.1"
Remove the node_modules/ directory from the library to rely on the parent project's React installation

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions