Breaking Customized change in 3.x #4437
Replies: 3 comments 3 replies
-
As long as the most important data is accessible via hooks, I say lets remove it. The most important thing (imo) is to be able to translate two values X and Y (i.e. "Page A", 2000 or 2000, 2000) into chart coordinates. That doesn't even exist in |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks everyone for your comments and votes! In conclusion: 3.0 will ship without |
Beta Was this translation helpful? Give feedback.
0 replies
-
When is Version 3.0 set to be released?? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Context
Okay so in 3.x we're changing how Recharts works internally and we're mostly able to do that without breaking the API. With one exception and that is
Customized
. This component exists as a workaround to the fact that Recharts will reject any custom components (#2788). It also provides (and this is not documented) access to full internal state of Recharts.Why the breaking changes?
Now for the sad part: the full access to internal state means we can't change that state without breaking the API. And that state happens to be in dire need of a change. So I really want to change that state which means breaking changes to Customized API.
Good news
And now the happy part: when 3.x is released, Recharts will allow rendering any custom components, without the need of the
Customized
wrapper. So that's good and one of the reasons for its existence will go away.What I want to do in 3.x
To make up for the lost access to internal state, we are going to introduce a set of React hooks. So instead of reading (undocumented and untyped) state from Customized component, users of the library will be able to use hooks to get access to internal and computed state of Recharts.
This will be documented, with TypeScript types out of the box, and examples.
Preview (the 3.x version may change)
We don't have the API locked in yet but it might look something like this:
That was the longest intro ever, what's the question?
12 votes ·
Beta Was this translation helpful? Give feedback.
All reactions