MCPcopy
hub / github.com/lit/lit / connectedCallback

Function connectedCallback

packages/reactive-element/src/reactive-element.ts:1137–1143  ·  view source on GitHub ↗

* On first connection, creates the element's renderRoot, sets up * element styling, and enables updating. * @category lifecycle

()

Source from the content-addressed store, hash-verified

1135 * @category lifecycle
1136 */
1137 connectedCallback() {
1138 // Create renderRoot before controllers `hostConnected`
1139 (this as Mutable<typeof this, 'renderRoot'>).renderRoot ??=
1140 this.createRenderRoot();
1141 this.enableUpdating(true);
1142 this.__controllers?.forEach((c) => c.hostConnected?.());
1143 }
1144
1145 /**
1146 * Note, this method should be considered final and not overridden. It is

Callers

nothing calls this directly

Calls 3

enableUpdatingMethod · 0.80
createRenderRootMethod · 0.65
hostConnectedMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…