Commit 5da3dab
committed
chore(rules): document render-phase ref-seed choice + no-render-in-render caveat
Two recurring pitfalls surfaced by the /w react-doctor pass:
- sim-hooks.md: when converting a mount-running useEffect to the prevX
render-phase idiom, the ref SEED decides mount behavior — sentinel vs
current value. Also: only convert useState->useRef when the value is never
read in render and never a hook dependency.
- sim-components.md: no-render-in-render is usually a false positive for
inline-called helpers (reconciled by position, no remount); extracting is
churn/risk unless mechanical.1 parent 76537c8 commit 5da3dab
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
0 commit comments