Commit a67ac5f
[charts] Fix DefaultContent formattedValue PropTypes warning
DefaultContent was generic over `T extends CartesianChartSeriesType |
PolarChartSeriesType`. With a bare type parameter, the conditional type
behind `SeriesItem<T>.formattedValue` (`T extends 'ohlc' ? object :
string`) stayed deferred, so the proptypes generator emitted
`PropTypes.object` — contradicting the component's runtime guard that
only renders string values. This produced a false-positive PropTypes
warning for any standard chart using a `valueFormatter` returning a
string.
Make `DefaultContent` non-generic with a concrete type argument that
excludes `'ohlc'` (candlestick provides its own AxisTooltipContent), so
the conditional resolves eagerly to `string`. Regenerated proptypes now
declare `formattedValue: PropTypes.string.isRequired`.
Closes mui#22926
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent a57d297 commit a67ac5f
1 file changed
Lines changed: 14 additions & 4 deletions
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
157 | 167 | | |
158 | 168 | | |
159 | 169 | | |
| |||
0 commit comments