We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
createShadowRootUi
1 parent 86d0c9b commit bc24ea4Copy full SHA for bc24ea4
docs/guide/content-script-ui.md
@@ -253,8 +253,12 @@ export default defineContentScript({
253
name: 'example-ui',
254
position: 'inline',
255
onMount: (container) => {
256
+ // Container is a body, and React warns when creating a root on the body, so create a wrapper div
257
+ const app = document.createElement('div');
258
+ container.append(app);
259
+
260
// Create a root on the UI container and render a component
- const root = ReactDOM.createRoot(container);
261
+ const root = ReactDOM.createRoot(app);
262
root.render(<App />);
263
return root;
264
},
0 commit comments