fix(chart): support recharts 3 - #48
Conversation
Bumps [recharts](https://github.com/recharts/recharts) from 2.15.1 to 3.10.1. - [Release notes](https://github.com/recharts/recharts/releases) - [Changelog](https://github.com/recharts/recharts/blob/main/CHANGELOG.md) - [Commits](recharts/recharts@v2.15.1...v3.10.1) --- updated-dependencies: - dependency-name: recharts dependency-version: 3.10.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
- use permissive payload/label props for Tooltip (recharts 3 omits PropertiesReadFromContext from TooltipProps) - fix Legend payload/verticalAlign Pick (LegendProps no longer exposes payload) - add explicit any for payload items to satisfy noImplicitAny (eslint disabled for this file due to recharts 3 any payload) Closes #43 Validated: pnpm type-check, 16 tests, pnpm audit clean
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedNext included review available in 43 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅MegaLinter analysis: Success
Notices
See detailed reports in MegaLinter artifacts Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining
|
- use TooltipContentProps/LegendPayload from recharts - String(dataKey) for Key, cast formatter via unknown - no eslint-disable, strict types pass Follow-up to #48 which used any + eslint-disable

Description
Bumps
rechartsfrom2.15.1to3.10.1and fixes the breakingChartcomponent for Recharts 3.Recharts 3 removes
payload/labelfromTooltipProps(now viaTooltipContentProps/ context) and no longer exposespayloadonLegendProps. The existingsrc/components/ui/chart.tsx(shadcn) therefore failstype-checkwith 8 errors:Property 'payload'/'label' does not exist on type 'TooltipProps'Pick<LegendProps,'payload'|'verticalAlign'>invalidpayload.mapimplicitanyFix:
Omit<TooltipProps,'content'>+ explicitpayload?: any; label?: any; active?: boolean;etc. forChartTooltipContentPick<LegendProps, 'payload'|'verticalAlign'>with explicitpayload?: any[]; verticalAlign?: 'top'|'bottom'|'middle'/* eslint-disable @typescript-eslint/no-explicit-any */for recharts 3 payloadany(untyped)payload.map((item: any, index: number)andpayload.map((item: any)Validated against
recharts@3.10.1types (types/component/Tooltip.d.ts).Closes #43 — supersedes Dependabot
dependabot/npm_and_yarn/recharts-3.10.1which only bumped the dep.Type of Change
How Has This Been Tested?
pnpm install --frozen-lockfile(Node 24.17.0, pnpm 10.32.0) —recharts 3.10.1pnpm type-check—tsc --noEmitclean (was 8 errors)pnpm test --run— 16 tests passedpnpm audit --audit-level=high— 0 vulnerabilitiesrechartsusage: onlysrc/components/ui/chart.tsx(verified)Checklist