From 34c11ee95131a5d5a12e6fee9c34e1a21b75660b Mon Sep 17 00:00:00 2001 From: Kar Rui Lau Date: Tue, 21 Nov 2023 16:33:10 +0800 Subject: [PATCH] feat(FormLabel): allow ReactNode instead of string (#560) type can safely be expanded --- react/src/FormControl/FormLabel/FormLabel.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/react/src/FormControl/FormLabel/FormLabel.tsx b/react/src/FormControl/FormLabel/FormLabel.tsx index 92ddfaec..1a8d1dd4 100644 --- a/react/src/FormControl/FormLabel/FormLabel.tsx +++ b/react/src/FormControl/FormLabel/FormLabel.tsx @@ -24,15 +24,15 @@ export interface FormLabelProps extends ChakraFormLabelProps { /** * Question number to be prefixed before each label, if any. */ - questionNumber?: string + questionNumber?: React.ReactNode /** * Tooltip text to be postfixed at the end of each label, if any. */ - tooltipText?: string + tooltipText?: React.ReactNode /** * Description text to be shown below the label text, if any. */ - description?: string + description?: React.ReactNode /** * Label text. */ @@ -107,9 +107,7 @@ export const FormLabel = ({ FormLabel.displayName = 'FormLabel' FormLabel.Label = ChakraFormLabel -interface FormLabelDescriptionProps extends TextProps { - children: string -} +interface FormLabelDescriptionProps extends TextProps {} const FormLabelDescription: FC = ({ children, ...props