{
  "about": "An entry of UpFork's ledger. Check it by hand as https://upfork.dev/docs/ledger says, or at https://upfork.dev/verify/E-33",
  "entry": {
    "seq": 33,
    "kind": "lesson-version",
    "record": "{\"ai\":{\"apps\":[\"Claude\"],\"models\":[\"Claude Opus 5.5\"]},\"article\":\"how-to-build-a-live-logistics-dashboard-a-simulated-fleet-maplibre-and-one-s\",\"articleRevision\":1,\"assumed\":\"`typeof window === \\\"undefined\\\" ? mode === \\\"dark\\\" : matchMedia(\\\"(prefers-color-scheme: dark)\\\").matches` was a safe way to read the effective theme in a component.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\",\"handle\":\"ramin-valadan\"},\"evidence\":\"`useIsDark()` in lib/ui-store.ts (Wayline commit 4a8798c).\",\"fix\":\"`useSyncExternalStore(subscribe, () => matchMedia(q).matches, () => false)`. React hydrates with the server's answer and switches right after, with no mismatch.\",\"happened\":\"with the theme on \\\"system\\\" and the computer in dark mode, React reported \\\"A tree hydrated but some attributes of the server rendered HTML didn't match the client properties\\\": the theme toggle's aria-label read \\\"Switch to dark mode\\\" on the server and \\\"Switch to light mode\\\" in the browser.\",\"kind\":\"my-mistake\",\"learnedBy\":\"ai\",\"lesson\":\"L-EDC0\",\"packages\":\"react@19.3, next@16.4\",\"product\":\"nextjs-logistics-fleet-management-template\",\"productRevision\":null,\"publishedAt\":\"2026-10-26T08:10:31.656Z\",\"site\":\"https://upfork.dev\",\"title\":\"prefers-color-scheme read during render breaks hydration; useSyncExternalStore with a server snapshot fixes it\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-EDC0\",\"version\":1,\"why\":\"\"}",
    "recordHash": "d7a879bd140b47ec81147e0ab12ba5539566b5bed0fc75465bab7ecea11bed84",
    "prevHash": "a7a5b5293b3858fa280a33824a3e7b0555ca6c12d89dc161fe65936f627f1a01",
    "entryHash": "76bb871fa4ab41cd25efddfa0a4d5924b82d843d45f914646ce4aee3ef49ddcf",
    "keyId": "k1",
    "signature": "d/CNTQWysN2LbbCn4e1m0HW05daH6TwbhCvC/ljT/nrpl3qQFoYM1VLjDq6uJEoa3oizkg9kEJPGa5kTPHtCBQ==",
    "recordedAt": "2026-10-26T08:11:08.910397+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [],
  "checkpoint": null,
  "keys": "https://upfork.dev/ledger/keys.json"
}