Skip to content

Commit 990eb2d

Browse files
committed
refactor: setup isControlledRef only when it was false before
1 parent 5dc0efe commit 990eb2d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-use-calendar-component/src/lib/hooks/useCalendarComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function useCalendarComponent<S extends SelectType = 'single'>({
4242
};
4343

4444
useEffect(() => {
45-
if (typeof userValue !== 'undefined') {
45+
if (!isControlledRef.current && typeof userValue !== 'undefined') {
4646
setInternalValue(undefined);
4747
isControlledRef.current = true;
4848
}

0 commit comments

Comments
 (0)