Commit c8760b6
Clarify why fetching stays in the Effect in "Fetching data"
The "Fetching data" example keeps `page` in the Effect's dependency
array while also updating it from `handleNextPageClick`, which reads as
a contradiction with the page's own advice to prefer event handlers.
Add a paragraph making the deciding factor explicit: fetch in the
handler when a value can *only* change from that event, and synchronize
in an Effect when the value can also change for other reasons (here,
`page` and `query` can both come from the URL via Back/Forward).
Addresses #8506
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SkNCfa3G9cdgYoYGefCbYm1 parent 9e97ad0 commit c8760b6
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
| 729 | + | |
| 730 | + | |
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
| |||
0 commit comments