@types/recharts package and had problems.In actual RechartsFunction type is missing optional value definition and can't use custom formatters for XAxis, YAxis etc.
Which formatters should be included in the definitions?
I.e. what is the signature of the methods you think are missing?
In the docs there is just mentioned function... (http://recharts.org/#/en-US/api/YAxis)
In my opinion it takes some kind of an object as parameter and has the same return type.
Maybe
tickFormatter: (value: any) => any;
is enough, but it could also be more specific.
@mthmulders and @royxue what do you think?
It's propType is PropTypes.func, so that doesn't really help us either. It's invoked with a parameter named text, suggesting its input might be a String. But I wouldn't rely on that either.
So I think (value: any) => any is indeed the best we can do...
@jetpack3331 Since the requested changes were included in the last merge, you could close this topic.
Thx @rapmue
I don't think this has been resolved. RechartsFunction is hiding parameter data in all the graphs in typescript at the moment. I am unable to use any mouse/click handlers to get graph data unless I override the RechartsFunction to take "value: any".
Example onClick for LineChart returns {activeCoordinate, activeLabel, activePayload, activeTooltipIndex, chartX, chartY} but the current typescript definitions prevent me from accessing this value parameter.
@tompuric In this issue the request was for formatters not callback functions. If you are unhappy with the current definitions, a pull request is appreciated.
Most helpful comment
It's propType is
PropTypes.func, so that doesn't really help us either. It's invoked with a parameter namedtext, suggesting its input might be a String. But I wouldn't rely on that either.So I think
(value: any) => anyis indeed the best we can do...