Skip to content

Tag: web-component

child elements usage in shadow dom

Is there any constraint that’s preventing <thead>, <tbody>, <tr> and so on to be slotted in shadow DOM? Given the following example: renders into the following structure: The workaround would be to use templates and insert template content with JS in slotchange event handler, but I wou…

When should I use componentDidMount?

In React componentDidMount is used during the mounting phase, for example, one can setState and wrap it in componentDidMount. But, one can use setState directly and then render the component. In which cases should I prefer componentDidMount for a mounting phase? Answer It’s useful for several things: St…