Commit 9aab0d3
committed
Inline stale-tag filter in usePersistedExpandedTagPaths
The hook was computing a filtered list of expanded paths in a
useEffect and writing it back to the persisted store — a derived-
state-plus-write-back pattern that React docs flag as an anti-
pattern. Move the filter into the render path so the hook returns
a clean Set each time; any toggle writes back the filtered value
so stale entries get pruned on next user action.1 parent 9396d85 commit 9aab0d3
1 file changed
Lines changed: 7 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
110 | 105 | | |
111 | 106 | | |
112 | | - | |
| 107 | + | |
113 | 108 | | |
114 | 109 | | |
115 | 110 | | |
| |||
0 commit comments