Programmatically adding React components via createRoot + render gives "Invalid Hook Call" error
This really sucks. I want to be able to programmatically mount React components from my content script when I feel like it, but if I try to use
createRoot
and render
from react-dom
then I just get an Invalid hook call
error.
Here is my plasmo-inline.ts
content script that I was using from the with-content-scripts-ui
example:
Then when I try to use the following component (TestComponent.tsx
):
I get this error:
Anyone know how to get around this?1 Reply
And then if I change the
plasmo-inline.ts
file to a .tsx
file and use TestComponent as JSX (
<TestComponent />`) then I end up with even more errors: