Skip to content

Commit 2d086fc

Browse files
Fix react bridge for react 16 (#3591)
Co-authored-by: Zack Jackson <25274700+ScriptedAlchemy@users.noreply.github.com>
1 parent 4d67b8f commit 2d086fc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/mighty-clocks-live.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/bridge-react': patch
3+
---
4+
5+
Fix react-bridge version check for React versions earlier than 16.13.0

packages/bridge/bridge-react/src/provider/compat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import ReactDOM from 'react-dom';
22
import { CreateRootOptions, Root } from '../types';
33

4-
const isReact18 = ReactDOM.version.startsWith('18');
4+
// ReactDOM.version is only available in React 16.13.0 and later
5+
const isReact18 = ReactDOM.version?.startsWith('18');
56

67
/**
78
* Creates a root for a container element compatible with both React 16 and 18

0 commit comments

Comments
 (0)