Skip to content

Commit cda1eeb

Browse files
committed
extract options params to avoid a new instance of an object at each render
1 parent ad0b4af commit cda1eeb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const RadioButtonGroupInput = (props: RadioButtonGroupInputProps) => {
9292
margin = 'dense',
9393
onBlur,
9494
onChange,
95-
options = {},
95+
options = defaultOptions,
9696
optionText = 'name',
9797
optionValue = 'id',
9898
parse,
@@ -291,3 +291,5 @@ const StyledFormControl = styled(FormControl, {
291291
transformOrigin: `top ${theme.direction === 'ltr' ? 'left' : 'right'}`,
292292
},
293293
}));
294+
295+
const defaultOptions = {};

0 commit comments

Comments
 (0)