{
  "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-687",
  "entry": {
    "seq": 687,
    "kind": "lesson-version",
    "record": "{\"ai\":{\"apps\":[\"Claude\"],\"models\":[\"Claude Opus 5.5\"]},\"appliesTo\":\"other: seen on React 19.3.1 and not specific to that version\",\"article\":\"how-to-make-a-product-fly-from-a-grid-to-its-detail-view-in-react-with-no-an\",\"articleRevision\":2,\"assumed\":\"a light, system and dark switch that starts on \\\"system\\\" could safely apply that choice when it mounts.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\"},\"check\":\"Frame the demo with a dark class set, on a machine set to light: `document.documentElement.classList.contains(\\\"dark\\\")` stays true.\",\"evidence\":\"sandboxed frames at 1280, 1100, 960, 753 and 390 px, in both themes, all three demos.\",\"fix\":\"no choice at all to begin with, shown as \\\"system\\\".\",\"format\":2,\"happened\":\"in a frame asked for dark, on a laptop set to light, it took the dark away. The demos without a switch came out right, which is how it showed.\",\"kind\":\"my-mistake\",\"learnedBy\":\"ai\",\"lesson\":\"L-ZCVV\",\"packages\":\"react@19.3.1\",\"product\":\"shoe-store-product-grid-react\",\"productRevision\":2,\"publishedAt\":\"2026-11-05T19:07:28.782Z\",\"rule\":\"If a demo loses the theme its frame asked for, its switch applied a default on mount. Start the choice at `null`, and inside a frame leave the theme alone until someone presses the switch.\",\"site\":\"https://upfork.dev\",\"snippet\":\"```tsx\\n// before: \\\"system\\\" is applied on mount, even inside a frame\\nconst [themeChoice, setThemeChoice] = useState<ThemeChoice>(\\\"system\\\");\\n// after\\nconst [themeChoice, setThemeChoice] = useState<ThemeChoice | null>(null);\\nuseEffect(() => {\\n  if (themeChoice === null && window.parent !== window) return;\\n  // apply the choice\\n}, [themeChoice]);\\n```\",\"title\":\"A demo's theme switch that applies itself on mount overrides the page framing it: start with no choice\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-ZCVV\",\"version\":2,\"why\":\"\"}",
    "recordHash": "a0df847e836ebdf8db9db02bb063a117fe13b5e48249d300a46a883a2f364a4d",
    "prevHash": "d890ef26c28a20d5317701c8c7cdd12ff90e7c8d25d6ad85172b25ebe102ec1a",
    "entryHash": "7120729ae9ff1160017b203c33c8cd0051a8e8ecb616f9af9281b26597950f1b",
    "keyId": "k1",
    "signature": "D26fuWjYQ8v87IC7tEFy+lVZ36udzbHPIGRaf+qH+JxI4q8iKF2Q1zX7897Nx+gbdWI/qsNKs2bo/i00P3jtBQ==",
    "recordedAt": "2026-11-05T19:07:33.632692+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [
    {
      "seq": 688,
      "prevHash": "7120729ae9ff1160017b203c33c8cd0051a8e8ecb616f9af9281b26597950f1b",
      "recordHash": "ab0b291b983c163a51863f4978c49710088d350fdffae92aa2f2a04f2b36d935",
      "entryHash": "6e1d4888412a7fa097162b5d2bf2c48873be2903917586b5090e7121e66adc49"
    },
    {
      "seq": 689,
      "prevHash": "6e1d4888412a7fa097162b5d2bf2c48873be2903917586b5090e7121e66adc49",
      "recordHash": "b69f406337b2f745d9e70963395628bf0e43fd9a2dbcf2592b80d3022d6c73f2",
      "entryHash": "f7e261b4a8fbdcb02c6f9726605bbb2d38f630d1da850472a673e98f90349d09"
    },
    {
      "seq": 690,
      "prevHash": "f7e261b4a8fbdcb02c6f9726605bbb2d38f630d1da850472a673e98f90349d09",
      "recordHash": "6988e938c51ee92b37193521ad4ddd173420a75b6a165f8a41deaf5a61cfae68",
      "entryHash": "4266569d2ed633630e3a41a96e03296ea2f95144e9b12ba78fab9674b5b3cbb9"
    },
    {
      "seq": 691,
      "prevHash": "4266569d2ed633630e3a41a96e03296ea2f95144e9b12ba78fab9674b5b3cbb9",
      "recordHash": "0fe4a478344dba3b8c2ba00aaa73c10e36f07cbfe0f527d1708c417747c6f3ed",
      "entryHash": "ed533de37726f58292973fac1fbc7bdf7001f52397c61d37b36431ac33f9f6e0"
    },
    {
      "seq": 692,
      "prevHash": "ed533de37726f58292973fac1fbc7bdf7001f52397c61d37b36431ac33f9f6e0",
      "recordHash": "74589a15a1b4611e364cb3b42111029462b8769119e4bbdcfd36fedc803c5563",
      "entryHash": "1fed955a5db8791193553f6a120cdbbc2e8b7e16825d3710074b5eaa172d29a7"
    },
    {
      "seq": 693,
      "prevHash": "1fed955a5db8791193553f6a120cdbbc2e8b7e16825d3710074b5eaa172d29a7",
      "recordHash": "eb2166cf72d18e60ebc30caa5851381cb6aa50cf2d13ac2fdac1e794eb3b662a",
      "entryHash": "5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4"
    },
    {
      "seq": 694,
      "prevHash": "5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4",
      "recordHash": "07db6a2295c37449982ceabc209bdcbd7f60caca0797f66c04c9d19fd9d156fb",
      "entryHash": "d734ffb1a3317816b9ea5d958398eb246c50b1e53bf835ea6d7d464aad386ac3"
    }
  ],
  "checkpoint": {
    "seq": 694,
    "kind": "checkpoint",
    "record": "{\"day\":\"2026-11-05\",\"entries\":693,\"head\":\"5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4\",\"site\":\"https://upfork.dev\",\"type\":\"checkpoint\"}",
    "recordHash": "07db6a2295c37449982ceabc209bdcbd7f60caca0797f66c04c9d19fd9d156fb",
    "prevHash": "5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4",
    "entryHash": "d734ffb1a3317816b9ea5d958398eb246c50b1e53bf835ea6d7d464aad386ac3",
    "keyId": "k1",
    "signature": "xY1u42cVAvTMY3BcCCN2xp2TPXaq91tImn9NrTemy1k9DlwJWANyzdhHbH+rjYv6sng8Ku+dCdouQ9CmKEiVDA==",
    "recordedAt": "2026-11-05T19:52:32.401331+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "author": {
    "account": "a_9d470b566acab5f65bdc",
    "handle": "ramin-valadan",
    "former": false,
    "recordFormat": 2
  },
  "keys": "https://upfork.dev/ledger/keys.json"
}