Commit 15c3594
committed
Fix useMemo deps growing between renders in SearchConditions (#94)
React warned 'The final argument passed to useMemo changed size between
renders': the deps array spread Object.values(vocabData), which grows
from 0 to N entries as vocabularies load. vocabData comes from
useSelector(..., shallowEqual) in useVocabs, so its identity already
changes exactly when some vocabulary's items change - use the object
itself as a constant-size dependency.1 parent 49f87a0 commit 15c3594
2 files changed
Lines changed: 7 additions & 2 deletions
File tree
- frontend/packages/volto-solr
- news
- src/components/theme/SolrSearch
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
151 | 155 | | |
152 | | - | |
| 156 | + | |
153 | 157 | | |
154 | 158 | | |
0 commit comments