mirror of
https://github.com/jambonz/chrome-extension-dialer.git
synced 2025-12-19 04:47:45 +00:00
fix
This commit is contained in:
@@ -64,16 +64,8 @@ export const ContentApp = () => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new div as an extension root
|
// Create a new div and attach it to the DOM
|
||||||
const extensionRoot = document.createElement("div");
|
const root = document.createElement("div");
|
||||||
document.body.appendChild(extensionRoot);
|
document.body.appendChild(root);
|
||||||
|
|
||||||
// Create a shadow root
|
ReactDOM.render(<ContentApp />, root);
|
||||||
const shadowRoot = extensionRoot.attachShadow({ mode: "open" });
|
|
||||||
|
|
||||||
// Now we create a mount point in the Shadow DOM
|
|
||||||
const reactRoot = document.createElement("div");
|
|
||||||
shadowRoot.appendChild(reactRoot);
|
|
||||||
|
|
||||||
// Render React App inside our shadow root within the mount point.
|
|
||||||
ReactDOM.render(<ContentApp />, reactRoot);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user