From a83f95fecce9222fd5bbeac0d491779d2e5b4cb8 Mon Sep 17 00:00:00 2001 From: ScriptSmith Date: Tue, 13 Aug 2024 15:01:04 +1000 Subject: [PATCH] Only render Text (

) when children is passed as a string --- .../tool/guide/Instructions/components/InstructionText.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/tool/guide/Instructions/components/InstructionText.js b/src/components/tool/guide/Instructions/components/InstructionText.js index 061f675a..188b2633 100644 --- a/src/components/tool/guide/Instructions/components/InstructionText.js +++ b/src/components/tool/guide/Instructions/components/InstructionText.js @@ -1,5 +1,9 @@ -import { Text } from "@chakra-ui/react"; +import { Box, Text } from "@chakra-ui/react"; export default function InstructionText({ children }) { - return {children}; + return typeof children === "string" ? ( + {children} + ) : ( + {children} + ); }