Skip to content

Commit

Permalink
feat(FormLabel): allow ReactNode instead of string (#560)
Browse files Browse the repository at this point in the history
type can safely be expanded
  • Loading branch information
karrui authored Nov 21, 2023
1 parent bcc2d8d commit 34c11ee
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions react/src/FormControl/FormLabel/FormLabel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -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<FormLabelDescriptionProps> = ({
children,
...props
Expand Down

0 comments on commit 34c11ee

Please sign in to comment.