-
-
Notifications
You must be signed in to change notification settings - Fork 454
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
I want to add a child element under the ”nav“ element once the nav sub elements have fully loaded. However, my current code is replacing all the existing children under the "nav".
the html:
"
_
aaa
bbb
_
"
script:
**export const getRootContainer = () =>
new Promise((resolve) => {
const checkInterval = setInterval(() => {
const rootContainer = document.querySelector("nav")
if (rootContainer) {
clearInterval(checkInterval)
resolve(rootContainer)
}
}, 137)
})
const PlasmoOverlay = () => {
return (
<span
style={{
background: "yellow",
padding: 12
}}>
HELLO WORLD ROOT CONTAINER
)
}
style={{
background: "yellow",
padding: 12
}}>
HELLO WORLD ROOT CONTAINER
export const render = async ({ createRootContainer }) => {
const rootContainer = await createRootContainer()
const root = createRoot(rootContainer)
root.render()
}
export default PlasmoOverlay**
Version
Latest
What OS are you seeing the problem on?
Windows
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
(OPTIONAL) Contact Details
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate problems.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working