File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
packages/bridge/bridge-react/src/provider Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @module-federation/bridge-react ' : patch
3
+ ---
4
+
5
+ feat: add error detection for react v19 under the default export createBaseBridgeComponent
Original file line number Diff line number Diff line change @@ -30,6 +30,16 @@ function defaultCreateRoot(
30
30
} {
31
31
const reactVersion = ReactDOM . version || '' ;
32
32
const isReact18 = reactVersion . startsWith ( '18' ) ;
33
+ const isReact19 = reactVersion . startsWith ( '19' ) ;
34
+
35
+ // For React 19, throw error and suggest using version-specific import
36
+ if ( isReact19 ) {
37
+ throw new Error (
38
+ `React 19 detected. The default export is not compatible with React 19. ` +
39
+ `Please use the version-specific import instead: ` +
40
+ `import { createBridgeComponent } from '@module-federation/bridge-react/v19'` ,
41
+ ) ;
42
+ }
33
43
34
44
// For React 18, use createRoot API
35
45
if ( isReact18 ) {
You can’t perform that action at this time.
0 commit comments