JavaScript querySelector – Select elements when the tag ends in a specified string

Advertisements I am getting started with Web Components and want to get all elements where the tag name ends in "-component", in order to register them as custom tags. For best performance, I want to use querySelectorAll and not iterate over all elements. However, as you can see in the following example [tag$="-component"] does not… Read More JavaScript querySelector – Select elements when the tag ends in a specified string

what does # mean in javascript

Advertisements Came across something I cant find in docs. This #selectedIndex = 0; what does # do? class WcTabPanel extends HTMLElement { static observedAttributes = ["selected-index", "direction"]; #selectedIndex = 0; appears in this example https://codepen.io/ndesmic/pen/mdELqbM >Solution : It means private field. Class fields are public by default, but private class members can be created by… Read More what does # mean in javascript

Element type is invalid: expected a string (for built-in components) or a class/function. while trying to render a component

Advertisements ` Unhandled Runtime Error Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it’s defined in, or you might have mixed up default and named imports. Check the render method of DashboardCards. `… Read More Element type is invalid: expected a string (for built-in components) or a class/function. while trying to render a component