Skip to content

Commit 51f74be

Browse files
committed
extract options param to avoid new instance of an object at each render
1 parent 969c0af commit 51f74be

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/ra-ui-materialui/src/input/BooleanInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const BooleanInput = (props: BooleanInputProps) => {
3030
resource,
3131
source,
3232
validate,
33-
options = {},
33+
options = defaultOptions,
3434
sx,
3535
...rest
3636
} = props;
@@ -119,3 +119,5 @@ export type BooleanInputProps = CommonInputProps &
119119
Omit<FormGroupProps, 'defaultValue' | 'onChange' | 'onBlur' | 'onFocus'> & {
120120
options: SwitchProps;
121121
};
122+
123+
const defaultOptions = {};

0 commit comments

Comments
 (0)