Skip to content

Cannot get shadowDOM contents in onMounted() #20

@nibushibu

Description

@nibushibu

When compiling Riot components to WebComponents with @riotjs/custom-elements, I get an error when trying to get an element in the Shadow DOM in onMounted().

As a workaround, if I use requestAnimaitonFrame() in onMounted() to delay the timing, it seems to work as intended.

I made a sample. Please refer to the following repository

https://github.com/nibushibu/riotjs-custom-elements-sample

P.S.
This is off-topic, but it seems that using custom-elements also disables the use of short-hand such as this.$() and this.$$().
This may be a specification and not a bug, but I thought it would be helpful if it was mentioned in @riot/custom-elements documentation.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions