diff --git a/packages/@react-stately/utils/src/useControlledState.ts b/packages/@react-stately/utils/src/useControlledState.ts index ab8b2bbb12e..f88f3aa3852 100644 --- a/packages/@react-stately/utils/src/useControlledState.ts +++ b/packages/@react-stately/utils/src/useControlledState.ts @@ -12,9 +12,9 @@ import {useCallback, useEffect, useRef, useState} from 'react'; -export function useControlledState(value: Exclude, defaultValue: Exclude | undefined, onChange?: (v: C, ...args: any[]) => void): [T, (value: T) => void]; -export function useControlledState(value: Exclude | undefined, defaultValue: Exclude, onChange?: (v: C, ...args: any[]) => void): [T, (value: T) => void]; -export function useControlledState(value: T, defaultValue: T, onChange?: (v: C, ...args: any[]) => void): [T, (value: T) => void] { +export function useControlledState(value: Exclude, defaultValue: Exclude | undefined, onChange?: (v: C, ...args: any[]) => void): [T, (value: T, ...args: any[]) => void]; +export function useControlledState(value: Exclude | undefined, defaultValue: Exclude, onChange?: (v: C, ...args: any[]) => void): [T, (value: T, ...args: any[]) => void]; +export function useControlledState(value: T, defaultValue: T, onChange?: (v: C, ...args: any[]) => void): [T, (value: T, ...args: any[]) => void] { let [stateValue, setStateValue] = useState(value || defaultValue); let isControlledRef = useRef(value !== undefined);