Recharts 2.1.14: Typing error at DefaultTooltipContent.tsx:83. value and name could be undefined while it is not expected. #2999
Labels
typescript
PRs or Issues surrounding Types or TS refactoring
Reproduction link
https://github.com/recharts/recharts
Steps to reproduce
What is expected?
The variables Value and Name should never be undefined at this state, but typescript seems to think it can still happen and create an error.
What is actually happening?
For the value variable
Argument of type 'TValue | undefined' is not assignable to parameter of type 'TValue'.
'TValue' could be instantiated with an arbitrary type which could be unrelated to 'TValue | undefined'.ts(2345)
For the name variable
Argument of type 'TName | undefined' is not assignable to parameter of type 'TName'.
'TName' could be instantiated with an arbitrary type which could be unrelated to 'TName | undefined'.
#2945
This file got recently updated in this PR: da6b9e2
The text was updated successfully, but these errors were encountered: