Open veedeo opened 11 months ago
I have faced the same issue, but if we are also customizing renderer, then everything works right.
So anyone faced this issue could try the solution below
export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({
createRootContainer
}) => {
const rootContainer = await createRootContainer()
const root = createRoot(rootContainer)
root.render(<SomeComponent />)
}
need a complete example,please。
export const getInlineAnchor = async () => document.querySelector(".home")
export const getRootContainer: PlasmoGetRootContainer = async ({ anchor }) => {
return anchor.element.appendChild(document.createElement("div"))
}
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
return (...)
}
export const render: PlasmoRender<PlasmoCSUIJSXContainer> = async ({
anchor,
createRootContainer
}) => {
console.log(anchor.element)
const rootContainer = await createRootContainer(anchor)
const root = createRoot(rootContainer)
root.render(<PlasmoOverlay />)
}
export default PlasmoOverlay
enter infinite loop
What happened?
This code works as expected
But I would like to customize root Container:
So when I add a custom getRootContainer() it runs in infinite loop, what Im missing here?
Version
Latest
What OS are you seeing the problem on?
No response
What browsers are you seeing the problem on?
No response
Relevant log output
No response
(OPTIONAL) Contribution
Code of Conduct