From d414ea1ad3a8b9e80fdde841678f32d3ea3ac162 Mon Sep 17 00:00:00 2001 From: Gabriel Jablonski Date: Sun, 2 Jul 2023 13:39:27 -0300 Subject: [PATCH] fix: `border` validation --- .../TooltipController/TooltipController.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/components/TooltipController/TooltipController.tsx b/src/components/TooltipController/TooltipController.tsx index 2c07a1f2..c23fd114 100644 --- a/src/components/TooltipController/TooltipController.tsx +++ b/src/components/TooltipController/TooltipController.tsx @@ -245,13 +245,11 @@ const TooltipController = ({ // eslint-disable-next-line no-console console.warn('[react-tooltip] Do not set `style.border`. Use `border` prop instead.') } - if (border) { - if (!cssAttrIsValid('border', border)) { - // eslint-disable-next-line no-console - console.warn( - `[react-tooltip] "${border}" is not a valid \`border\`. See https://developer.mozilla.org/en-US/docs/Web/CSS/border`, - ) - } + if (border && !cssAttrIsValid('border', border)) { + // eslint-disable-next-line no-console + console.warn( + `[react-tooltip] "${border}" is not a valid \`border\`. See https://developer.mozilla.org/en-US/docs/Web/CSS/border`, + ) } }, [])