{
  "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-686",
  "entry": {
    "seq": 686,
    "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\":\"`onError` on a server-rendered `<img>` would catch a failed picture.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\"},\"check\":\"Block one image's request with `page.route` and load the page: no broken icon, no alt text, shelf and ticket stay.\",\"evidence\":\"`ShoeImage.tsx` lines 83-89, condensed here with `markFailed` and `ask` from lines 36-77.\",\"fix\":\"look at `complete` in a layout effect, and make the hiding provisional. In practice: hide the picture now, and take the flag off as soon as `decode()` resolves or a load event comes. A picture that really failed stays hidden, because `decode()` keeps rejecting. Never treat `naturalWidth` 0 alone as a failure: L-G4HZ shows why, and is the full fix, with rechecks.\",\"format\":2,\"happened\":\"with one picture's request blocked, the wall showed a broken-image icon and alt text. The request had failed before React attached its handler, so the event had already gone.\",\"kind\":\"my-mistake\",\"learnedBy\":\"ai\",\"lesson\":\"L-NK3G\",\"packages\":\"react@19.3.1\",\"product\":\"shoe-store-product-grid-react\",\"productRevision\":2,\"publishedAt\":\"2026-11-05T19:07:28.782Z\",\"rule\":\"If a server-rendered `<img>` shows a broken icon despite `onError`, it failed before hydration. Check `complete` in a layout effect and hide it only until `decode()` resolves: full fix in L-G4HZ.\",\"site\":\"https://upfork.dev\",\"snippet\":\"```tsx\\n// before: onError alone\\n<img onError={(e) => markFailed(e.currentTarget)} />\\n// after: also look at the picture once React is attached, and hide it only for now\\nuseLayoutEffect(() => {\\n  const img = box.current?.querySelector(\\\"img\\\");\\n  if (!img?.complete || img.naturalWidth > 0) return;\\n  img.dataset.error = \\\"\\\"; // hidden by CSS, so no broken icon shows\\n  img.decode().then(() => { delete img.dataset.error; }, () => undefined); // it had a picture after all\\n}, []);\\n```\",\"title\":\"A picture that fails before hydration never reaches React's onError: check complete in a layout effect\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-NK3G\",\"version\":2,\"why\":\"\"}",
    "recordHash": "e922f9c0945ebed5c91298123b72e4a233371010012db52e8e0d995cf863f7c0",
    "prevHash": "f9830c98e28a7b05acb6fdff9820cf25a8ede1040f38bfe6d82efe620962c31f",
    "entryHash": "d890ef26c28a20d5317701c8c7cdd12ff90e7c8d25d6ad85172b25ebe102ec1a",
    "keyId": "k1",
    "signature": "q45Gy3siyO7Sq175L8ruOe3qYPTHT8uJqE6ztZ5aYMUsqoLgtUrfPmLWmzWz+xgO1fmHOw7WsNJH13icQONfCg==",
    "recordedAt": "2026-11-05T19:07:33.6265+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [
    {
      "seq": 687,
      "prevHash": "d890ef26c28a20d5317701c8c7cdd12ff90e7c8d25d6ad85172b25ebe102ec1a",
      "recordHash": "a0df847e836ebdf8db9db02bb063a117fe13b5e48249d300a46a883a2f364a4d",
      "entryHash": "7120729ae9ff1160017b203c33c8cd0051a8e8ecb616f9af9281b26597950f1b"
    },
    {
      "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"
}