From b5359be1654701528c26a37c234127c5378d3758 Mon Sep 17 00:00:00 2001 From: Enguerran Weiss Date: Mon, 24 Jul 2023 12:20:34 +0200 Subject: [PATCH] alert description tag depends on its content --- src/Alert.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Alert.tsx b/src/Alert.tsx index 8db03d0d..cccb9d7a 100644 --- a/src/Alert.tsx +++ b/src/Alert.tsx @@ -108,6 +108,7 @@ export const Alert = memo( const refShouldButtonGetFocus = useRef(false); const refShouldSetRole = useRef(false); + const DescriptionTag = typeof description === "string" ? "p" : "div"; useEffect(() => { if (props_isClosed === undefined) { @@ -172,7 +173,7 @@ export const Alert = memo( {title} )} -

{description}

+ {description} {isClosable && (