Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for some guidance on a typing issue #4257

Open
roger-tbg opened this issue Mar 2, 2024 · 1 comment
Open

Looking for some guidance on a typing issue #4257

roger-tbg opened this issue Mar 2, 2024 · 1 comment
Labels
pending response Pending response from the issue requester question Issue that is a question about recharts rather than a bug or a feature request

Comments

@roger-tbg
Copy link

roger-tbg commented Mar 2, 2024

I imagine this is "well it depends" -- but can't seem to reverse engineer how i'd construct a type to satisfy what "payload" might be for a Custom Tooltip

CleanShot 2024-03-02 at 13 22 37@2x

@ckifer
Copy link
Member

ckifer commented Mar 2, 2024

For now you can either log what payload is and construct your own type from that, or ignore the linter warning and let it be typed as any (as unfortunate as that is).

These kind of issues stem from the fact that recharts used to be a JS only project. When it was refactored to TS (before me), a lot of any types were added to the code leaving things such as this untyped. Once people started using those types, recharts couldn't update anything without breaking changes.

All that being said, we'll hopefully have stricter types on things in 3.x

@ckifer ckifer added pending response Pending response from the issue requester question Issue that is a question about recharts rather than a bug or a feature request labels Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending response Pending response from the issue requester question Issue that is a question about recharts rather than a bug or a feature request
Projects
None yet
Development

No branches or pull requests

2 participants