Move DOM manipulation from constructors to connectedCallback #1 #1

Open
opened 2024-01-22 18:14:53 +01:00 by nilsnh · 0 comments
Owner

Even though all the workshop code work well, I learned that technically DOM manipulation should not happen in the web component constructor() {} but rather as part of the connectedCallback() call. See: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-conformance

Shout out to @andlbrei for researching this. 🙌

Even though all the workshop code work well, I learned that technically DOM manipulation should not happen in the web component `constructor() {}` but rather as part of the `connectedCallback()` call. See: https://html.spec.whatwg.org/multipage/custom-elements.html#custom-element-conformance Shout out to @andlbrei for researching this. 🙌
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: nilsnh/workshop-on-web-components#1
No description provided.