Tooltip formatter の TypeScript 型エラーを修正
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -214,7 +214,10 @@ export default function WeatherPage() {
|
|||||||
domain={['auto', 'auto']}
|
domain={['auto', 'auto']}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
formatter={(value: number | null) => value == null ? '—' : `${value.toFixed(1)}℃`}
|
formatter={(value: unknown) => {
|
||||||
|
if (value == null || typeof value !== 'number') return '—';
|
||||||
|
return `${value.toFixed(1)}℃`;
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Legend />
|
<Legend />
|
||||||
<Line
|
<Line
|
||||||
@@ -266,8 +269,8 @@ export default function WeatherPage() {
|
|||||||
tickFormatter={(v) => `${v}h`}
|
tickFormatter={(v) => `${v}h`}
|
||||||
/>
|
/>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
formatter={(value: number | null, name: string) => {
|
formatter={(value: unknown, name: unknown) => {
|
||||||
if (value == null) return '—';
|
if (value == null || typeof value !== 'number') return '—';
|
||||||
return name === '降水量' ? `${value} mm` : `${value} h`;
|
return name === '降水量' ? `${value} mm` : `${value} h`;
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user