matthewp / haunted

React's Hooks API implemented for web components 👻

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Putting innerText directly as child throws an Illegal Invocation error

NathanDeveloping opened this issue · comments

Hi!

I tried to render different components made with LitHTML + Haunted and it appears that every time I put inner text as direct webcomponent child, it throws an Illegal Invocation error.

import '@neovici/cosmoz-autocomplete';
...
<cosmoz-autocomplete>
        inner text
</cosmoz-autocomplete>

Screenshot 2020-04-30 at 11 21 04

wc-inner-text-trace

The webcomponent are installed from npm packages and used as it is in a React environment. It works well if you wrap your inner text in a dom element.

import '@neovici/cosmoz-autocomplete';
...
<cosmoz-autocomplete>
        <span>inner text</span>
</cosmoz-autocomplete>

Thank you in advance for your help.

Finally, I managed to put inner text in a vanilla environment. It seems to be related to React. I'm closing this issue.