update method

void update()

Forces a re-render of the component.

Implementation

void update() {
  if (!isHydrated) return;

  // On the browser, styles are already applied via adoptedStyleSheets in onMount().
  // We only need the build() result, not the style element, to avoid CSP issues
  // with dynamically created <style> tags that wouldn't have a nonce.
  final newVdom = [build()];

  _wrapEventsInList(newVdom);

  final root = shadowRoot;
  if (root != null) {
    vdom.mountList(root, newVdom);
  } else {
    vdom.mountList(element, newVdom);
  }
}