Skip to content

Commit a42222a

Browse files
committed
Resolve useEffect dependency
1 parent ab17709 commit a42222a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/components/Datepicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const Datepicker: React.FC<Props> = ({
231231
end: null
232232
});
233233
}
234-
}, [asSingle, value, displayFormat]);
234+
}, [asSingle, value, displayFormat, separator]);
235235

236236
// Variable
237237
const colorPrimary = useMemo(() => {

src/components/Input.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ const Input: React.FC = () => {
115115
dayHover,
116116
inputText,
117117
period.end,
118-
period.start
118+
period.start,
119+
readOnly
119120
]);
120121

121122
useEffect(() => {
@@ -159,7 +160,7 @@ const Input: React.FC = () => {
159160
input.removeEventListener("focus", showCalendarContainer);
160161
}
161162
};
162-
}, [calendarContainer, arrowContainer]);
163+
}, [calendarContainer, arrowContainer, readOnly]);
163164

164165
return (
165166
<>

0 commit comments

Comments
 (0)