Commit cb46db8
committed
fix: use anyChanged flag to preserve array referential identity in useStableRows
The anyChanged variable was assigned but never read, causing a new array
reference to always be returned from useMemo even when all rows were
structurally identical. This partially defeated the purpose of the
structural sharing hook for LegendList's data prop.
Now we track the previous result and return it when no rows changed,
preserving referential identity and avoiding unnecessary list
reconciliation.1 parent 97ca347 commit cb46db8
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
785 | 785 | | |
786 | 786 | | |
787 | 787 | | |
| 788 | + | |
788 | 789 | | |
789 | 790 | | |
790 | 791 | | |
791 | 792 | | |
792 | | - | |
| 793 | + | |
793 | 794 | | |
794 | 795 | | |
795 | 796 | | |
| |||
803 | 804 | | |
804 | 805 | | |
805 | 806 | | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
806 | 810 | | |
807 | 811 | | |
808 | 812 | | |
| |||
0 commit comments