Commit 849d568
fix: ensure chart data is always an array to prevent r.slice crash
Add Array.isArray() guards at three layers:
- ObjectChart.tsx: validate finalData before passing to ChartRenderer
- ChartRenderer.tsx: validate schema.data in useMemo adapter
- AdvancedChartImpl.tsx: validate data prop before passing to Recharts
When boundData (from useDataScope) or schema.data is a non-array truthy
value (e.g. an object), Recharts internally calls .slice() on it,
causing "r.slice is not a function" runtime error.
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>1 parent c45d73a commit 849d568
3 files changed
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
0 commit comments