diff --git a/packages/ibm-products/src/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.tsx b/packages/ibm-products/src/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.tsx index 8ca75a6b3f..deda7fb3d0 100644 --- a/packages/ibm-products/src/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.tsx +++ b/packages/ibm-products/src/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.tsx @@ -53,14 +53,14 @@ export const ConditionBuilderButton = ({ ...rest }: ConditionBuilderButtonProps) => { const [tooltipText, setTooltipText] = useState(label); + useEffect(() => { if (description) { setTooltipText(description as string); } else { setTooltipText(label); } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [description]); + }, [description, label]); const carbonPrefix = usePrefix(); const Button = () => {