Skip to content

Commit ccd6082

Browse files
committed
fix(FormControl): rever console.error label change
1 parent 812bc6d commit ccd6082

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/react/src/FormControl/FormControl.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ const FormControl = React.forwardRef<HTMLDivElement, FormControlProps>(
8080
)
8181
}
8282

83-
warning(
84-
!slots.label,
85-
`The input field with the id ${id} MUST have a FormControl.Label child.\n\nIf you want to hide the label, pass the 'visuallyHidden' prop to the FormControl.Label component.`,
86-
)
83+
if (!slots.label) {
84+
// eslint-disable-next-line no-console
85+
console.error(
86+
`The input field with the id ${id} MUST have a FormControl.Label child.\n\nIf you want to hide the label, pass the 'visuallyHidden' prop to the FormControl.Label component.`,
87+
)
88+
}
8789

8890
if (isChoiceInput) {
8991
warning(

0 commit comments

Comments
 (0)