From 82439cca83446e566066aaf4b7d729a495926aa2 Mon Sep 17 00:00:00 2001 From: Quan HL Date: Mon, 25 Sep 2023 14:12:05 +0700 Subject: [PATCH] fix --- src/content/index.tsx | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/content/index.tsx b/src/content/index.tsx index 68784f1..adf9e8c 100644 --- a/src/content/index.tsx +++ b/src/content/index.tsx @@ -64,16 +64,8 @@ export const ContentApp = () => { ); }; -// Create a new div as an extension root -const extensionRoot = document.createElement("div"); -document.body.appendChild(extensionRoot); +// Create a new div and attach it to the DOM +const root = document.createElement("div"); +document.body.appendChild(root); -// Create a shadow 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(, reactRoot); +ReactDOM.render(, root);