[charts][RFC] Replace DefaultXxxx
by the usage of hooks
#13819
Labels
breaking change
component: charts
This is the name of the generic UI component, not the React module!
RFC
Request For Comments
v8.x
Related messages
#13209 (comment)
#13700 (comment)
Issues that could be solved with it
Current state
The initial idea of slots was to provide developers with a simple interface to plug their custom components.
For example if they want to customize the tooltip, we provide all the data needed to the
slots.tooltip
and then they are responsible for rendering the content of the tooltip.But the tooltip for an axis does not require the same data as a tooltip for an item. So either we have
slots.tooltip = (props: AxisTooltipProps | ItemTooltipProps) => ...
. Or we creat two slots.For now, we went with
Similar issue occurs for the legend due to the introduction of color legend (we have series legend, piecewise color legend, and continuous color legend)
Issue
This current solution seems to be contrary to the idea of supporting composition. Currently to have access to the processed data, a custom tooltip should be done as follows:
Proposal
I propose to stop this pattern and use hooks instead.
Potential issues
Will need a nice docs for discoverability
Search keywords:
The text was updated successfully, but these errors were encountered: