Skip to content

fix(chart): support recharts 3 - #48

Merged
ulises-jeremias merged 2 commits into
mainfrom
fix/recharts-3
Aug 27, 2026
Merged

fix(chart): support recharts 3#48
ulises-jeremias merged 2 commits into
mainfrom
fix/recharts-3

Conversation

@ulises-jeremias

Copy link
Copy Markdown
Member

Description

Bumps recharts from 2.15.1 to 3.10.1 and fixes the breaking Chart component for Recharts 3.

Recharts 3 removes payload/label from TooltipProps (now via TooltipContentProps / context) and no longer exposes payload on LegendProps. The existing src/components/ui/chart.tsx (shadcn) therefore fails type-check with 8 errors:

  • Property 'payload'/'label' does not exist on type 'TooltipProps'
  • Pick<LegendProps,'payload'|'verticalAlign'> invalid
  • payload.map implicit any

Fix:

  • Use Omit<TooltipProps,'content'> + explicit payload?: any; label?: any; active?: boolean; etc. for ChartTooltipContent
  • Replace Pick<LegendProps, 'payload'|'verticalAlign'> with explicit payload?: any[]; verticalAlign?: 'top'|'bottom'|'middle'
  • Add /* eslint-disable @typescript-eslint/no-explicit-any */ for recharts 3 payload any (untyped)
  • Type payload.map((item: any, index: number) and payload.map((item: any)

Validated against recharts@3.10.1 types (types/component/Tooltip.d.ts).

Closes #43 — supersedes Dependabot dependabot/npm_and_yarn/recharts-3.10.1 which only bumped the dep.

Type of Change

  • Bug fix
  • Dependency maintenance
  • New feature
  • Breaking change

How Has This Been Tested?

  • pnpm install --frozen-lockfile (Node 24.17.0, pnpm 10.32.0) — recharts 3.10.1
  • pnpm type-checktsc --noEmit clean (was 8 errors)
  • pnpm test --run — 16 tests passed
  • pnpm audit --audit-level=high — 0 vulnerabilities
  • Local recharts usage: only src/components/ui/chart.tsx (verified)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

dependabot Bot and others added 2 commits August 27, 2026 00:35
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
@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
create-awesome-python-app-website Ready Ready Preview Aug 27, 2026 3:39am

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 43 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c99a4cf4-6dd6-4033-ab0c-ef58eb57139b

📥 Commits

Reviewing files that changed from the base of the PR and between 5d19aa8 and e07661c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/components/ui/chart.tsx

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor
Warnings
⚠️ 🔒 package.json - Changes were made to package.json.
⚠️ This PR is changing more than 200 lines.

Generated by 🚫 dangerJS against e07661c

@github-actions

Copy link
Copy Markdown
Contributor

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 5 0 0 0.07s
✅ COPYPASTE jscpd yes no no 0.82s
✅ EDITORCONFIG editorconfig-checker 172 0 0 0.19s
✅ JAVASCRIPT standard 1 0 0 1.02s
✅ JSON jsonlint 9 0 0 0.07s
✅ JSON npm-package-json-lint yes no no 0.49s
✅ JSON prettier 9 0 0 0.33s
✅ JSON v8r 9 0 0 12.38s
✅ MARKDOWN markdownlint 9 0 0 0.46s
✅ MARKDOWN markdown-table-formatter 9 0 0 0.18s
✅ REPOSITORY betterleaks yes no no 0.66s
✅ REPOSITORY checkov yes no no 13.59s
✅ REPOSITORY git_diff yes no no 0.01s
✅ REPOSITORY osv-scanner yes no no 1.75s
✅ REPOSITORY secretlint yes no no 1.97s
✅ REPOSITORY trivy yes no no 10.45s
✅ REPOSITORY trufflehog yes no no 3.21s
✅ SPELL cspell 173 0 0 3.58s
✅ YAML prettier 13 0 0 0.41s
✅ YAML yamllint 13 0 0 0.88s

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: MARKDOWN_MARKDOWN_LINK_CHECK. See Removed linters to find their replacements.

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 FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.0.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,COPYPASTE_JSCPD,EDITORCONFIG_EDITORCONFIG_CHECKER,JAVASCRIPT_STANDARD,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,JSON_NPM_PACKAGE_JSON_LINT,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_TRIVY,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,YAML_PRETTIER,YAML_YAMLLINT

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@ulises-jeremias
ulises-jeremias merged commit ddc5853 into main Aug 27, 2026
9 checks passed
@ulises-jeremias
ulises-jeremias deleted the fix/recharts-3 branch August 27, 2026 03:40
ulises-jeremias added a commit that referenced this pull request Aug 27, 2026
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant