@@ -18,7 +18,7 @@ import {filterDOMProps, mergeRefs, useObjectRef} from '@react-aria/utils';
18
18
import { FormContext } from './Form' ;
19
19
import { forwardRefType , RefObject } from '@react-types/shared' ;
20
20
import { LabelContext } from './Label' ;
21
- import React , { createContext , ForwardedRef , forwardRef , useContext } from 'react' ;
21
+ import React , { createContext , ForwardedRef , forwardRef , useContext , useMemo } from 'react' ;
22
22
import { TextContext } from './Text' ;
23
23
24
24
export interface CheckboxGroupProps extends Omit < AriaCheckboxGroupProps , 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior' > , RACValidation , RenderProps < CheckboxGroupRenderProps > , SlotProps { }
@@ -185,7 +185,7 @@ export const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Ch
185
185
let { validationBehavior : formValidationBehavior } = useSlottedContext ( FormContext ) || { } ;
186
186
let validationBehavior = props . validationBehavior ?? formValidationBehavior ?? 'native' ;
187
187
let groupState = useContext ( CheckboxGroupStateContext ) ;
188
- let inputRef = useObjectRef ( mergeRefs ( userProvidedInputRef , props . inputRef !== undefined ? props . inputRef : null ) ) ;
188
+ let inputRef = useObjectRef ( useMemo ( ( ) => mergeRefs ( userProvidedInputRef , props . inputRef !== undefined ? props . inputRef : null ) , [ userProvidedInputRef , props . inputRef ] ) ) ;
189
189
let { labelProps, inputProps, isSelected, isDisabled, isReadOnly, isPressed, isInvalid} = groupState
190
190
// eslint-disable-next-line react-hooks/rules-of-hooks
191
191
? useCheckboxGroupItem ( {
0 commit comments