What is the current behavior?
formatter prop from chart components is no longer passed to the entry of a tooltip.
This code block seems to be redundant now – how can entry.formatter ever be defined?:
|
const finalFormatter = entry.formatter || formatter || defaultFormatter; |
What is the expected behavior?
Old behaviour (even though it wasn't properly typed, it allowed better composability of tooltip formatters imho, it's bad ergonomics to have to run conditional logic based on dataKeys, especially if some charts are conditionally/dynamically rendered): https://codesandbox.io/p/sandbox/nice-bush-vhvyjp?file=%2Fsrc%2FApp.tsx
What is the current behavior?
formatterprop from chart components is no longer passed to theentryof a tooltip.This code block seems to be redundant now – how can
entry.formatterever be defined?:recharts/src/component/DefaultTooltipContent.tsx
Line 89 in 5a5989f
What is the expected behavior?
Old behaviour (even though it wasn't properly typed, it allowed better composability of tooltip formatters imho, it's bad ergonomics to have to run conditional logic based on dataKeys, especially if some charts are conditionally/dynamically rendered): https://codesandbox.io/p/sandbox/nice-bush-vhvyjp?file=%2Fsrc%2FApp.tsx