10LOC

#ssr

Reactintermediate

useId for stable, SSR-safe unique ids

import { useId } from "react";

export const PasswordField = () => {
  const id = useId();

Generate ids that match between server and client render, so aria-describedby and label associations survive hydration without a mismatch.

Chrome APIsadvanced

Declarative Shadow DOM for server-rendered web components

<user-card>
  <template shadowrootmode="open">
    <style>
      :host { display: block; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; }
      .name { font-weight: 600; margin: 0; }

A <template shadowrootmode> is parsed straight into a real shadow root by the HTML parser — a web component's shadow tree, fully rendered before any JS runs.