5 ms·
>These are web components and work fine within React already I tried with a simple CodeSandbox and they are not working for me. ( Unless I'm doing something wro
by hugozap 8y ago
>These are web components and work fine within React already
I tried with a simple CodeSandbox and they are not working for me. ( Unless I'm doing something wrong? )
https://codesandbox.io/s/pp4q7kw9q7 https://codesandbox.io/s/pp4q7kw9q7
- d4l3k 8y agoThere's something weird going on in Chrome. This link works in Firefox though with the webcomponents polyfill https://codesandbox.io/s/jn85y61kx9 https://codesandbox.io/s/jn85y61kx9
- shihn 8y agoI believe it's a shadow dom issue. Firefox doesnt support Shadow DOM yet so a 'shady dom' is used by the polyfill
- e111077 8y agoThis seems to be because you are accessing the DOM of the element from the constructor which is a no no. Here's a simple repro: https://stackblitz.com/edit/lit-element-react-attributes-location?file=my-element.js https://stackblitz.com/edit/lit-element-react-attributes-loc...
- swyx 8y agostuff like this is why i have trust issues with people who try to push webcomponents on me. I'm either not smart enough to understand why i dont get it, or its just not ready yet.
- shihn 8y agoAll working with react now. There was an issue wired-elements code: Here's a react demo: https://stackblitz.com/edit/wired-elements-react?file=index.js https://stackblitz.com/edit/wired-elements-react?file=index....