From d76c05665676d610ece50c34e1ec0a13a671ee3f Mon Sep 17 00:00:00 2001 From: Dominik Prokop Date: Fri, 23 Apr 2021 15:50:34 +0200 Subject: [PATCH] Revert "LegendIcon: only render color picker when the props change (#33141)" (#33313) This reverts commit af46bbf65469f19732bc7abf0bd6366a8d66b024. --- .../VizLegend/VizLegendSeriesIcon.tsx | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendSeriesIcon.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendSeriesIcon.tsx index 22c098105ef..fb0316341e3 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendSeriesIcon.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendSeriesIcon.tsx @@ -8,29 +8,25 @@ interface Props { onColorChange: (color: string) => void; } -export const VizLegendSeriesIcon = React.memo( - ({ disabled, color, onColorChange }) => { - return disabled ? ( - - ) : ( - - {({ ref, showColorPicker, hideColorPicker }) => ( - - )} - - ); - }, - // areEqual -- return true if they are the same. - // onColorChange updates frequently, so ignore that - (prevProps, nextProps) => { - return prevProps.color === nextProps.color && prevProps.disabled === nextProps.disabled; - } -); +/** + * @internal + */ +export const VizLegendSeriesIcon: React.FunctionComponent = ({ disabled, color, onColorChange }) => { + return disabled ? ( + + ) : ( + + {({ ref, showColorPicker, hideColorPicker }) => ( + + )} + + ); +}; VizLegendSeriesIcon.displayName = 'VizLegendSeriesIcon';