Skip to content

Commit

Permalink
Merge pull request #4995 from marmelab/search-input-label
Browse files Browse the repository at this point in the history
Fix SearchInput with label prop renders incorrectly
  • Loading branch information
djhi authored Jun 30, 2020
2 parents 10f7c7d + dc28201 commit 46f9e47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/ra-ui-materialui/src/input/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ const SearchInput: FunctionComponent<
const { classes: classesOverride, ...rest } = props;
const translate = useTranslate();
const classes = useStyles(props);
if (props.label) {
throw new Error(
"<SearchInput> isn't designed to be used with a label prop. Use <TextInput> if you need a label."
);
}

return (
<TextInput
Expand Down

0 comments on commit 46f9e47

Please sign in to comment.