+- The first thing that gets executed, is the `constructor()`. Because this always gets executed when an object gets created based on our class, and then the class's constructor gets executed. So this is essentially called when the element is created. It's created in memory first and it's not part of the DOM at the beginning. So the `constructor()` is great for some basic initializations, some basic values for the different properties and variables we might be using in our class, in our component, but it's the wrong place for accessing the DOM. Because our custom element has not been added to the DOM yet.
0 commit comments