File tree Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Expand file tree Collapse file tree 2 files changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,27 @@ bun add @module-federation/enhanced
56
56
57
57
### 3. Exporting Modules by the Producer
58
58
59
+ > Change the entry file to asynchronous
60
+
61
+
62
+ ``` tsx
63
+ // Move src/index.tsx to a newly created src/bootstrap.tsx file
64
+ // src/index.tsx
65
+ import (' ./bootstrap' );
66
+
67
+ // src/bootstrap.tsx
68
+ import React from ' react' ;
69
+ import ReactDOM from ' react-dom/client' ;
70
+ import App from ' ./App' ;
71
+
72
+ const root = ReactDOM .createRoot (document .getElementById (' root' )! );
73
+ root .render (
74
+ <React.StrictMode >
75
+ <App />
76
+ </React.StrictMode >,
77
+ );
78
+ ```
79
+
59
80
> Add a Button Component
60
81
61
82
``` tsx
@@ -204,7 +225,7 @@ root.render(
204
225
``` json
205
226
{
206
227
"compilerOptions" : {
207
- "path " :{
228
+ "paths " :{
208
229
"*" : [" ./@mf-types/*" ]
209
230
}
210
231
}
@@ -254,7 +275,7 @@ import React from 'react';
254
275
import ReactDOM from ' react-dom/client' ;
255
276
import App from ' ./App' ;
256
277
257
- const root = ReactDOM .createRoot (document .getElementById (' root' ));
278
+ const root = ReactDOM .createRoot (document .getElementById (' root' )! );
258
279
root .render (
259
280
<React.StrictMode >
260
281
<App />
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ import React from 'react';
66
66
import ReactDOM from ' react-dom/client' ;
67
67
import App from ' ./App' ;
68
68
69
- const root = ReactDOM .createRoot (document .getElementById (' root' ));
69
+ const root = ReactDOM .createRoot (document .getElementById (' root' )! );
70
70
root .render (
71
71
<React.StrictMode >
72
72
<App />
@@ -237,7 +237,7 @@ import React from 'react';
237
237
import ReactDOM from ' react-dom/client' ;
238
238
import App from ' ./App' ;
239
239
240
- const root = ReactDOM .createRoot (document .getElementById (' root' ));
240
+ const root = ReactDOM .createRoot (document .getElementById (' root' )! );
241
241
root .render (
242
242
<React.StrictMode >
243
243
<App />
You can’t perform that action at this time.
0 commit comments