fix: add explicit type annotations to setState callbacks in time-range-context
Fixes TypeScript strict mode error where callback parameters implicitly had 'any' type.
This commit is contained in:
@@ -68,24 +68,24 @@ export function TimeRangeProvider({ children }: { children: ReactNode }) {
|
|||||||
|
|
||||||
const setRange = useCallback((r: TimeRange) => {
|
const setRange = useCallback((r: TimeRange) => {
|
||||||
setRangeState(r);
|
setRangeState(r);
|
||||||
setCustomStartState(prev => {
|
setCustomStartState((prev: string) => {
|
||||||
setCustomEndState(end => { persist(r, prev, end); return end; });
|
setCustomEndState((end: string) => { persist(r, prev, end); return end; });
|
||||||
return prev;
|
return prev;
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const setCustomStart = useCallback((s: string) => {
|
const setCustomStart = useCallback((s: string) => {
|
||||||
setCustomStartState(s);
|
setCustomStartState(s);
|
||||||
setRangeState(r => {
|
setRangeState((r: TimeRange) => {
|
||||||
setCustomEndState(end => { persist(r, s, end); return end; });
|
setCustomEndState((end: string) => { persist(r, s, end); return end; });
|
||||||
return r;
|
return r;
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const setCustomEnd = useCallback((e: string) => {
|
const setCustomEnd = useCallback((e: string) => {
|
||||||
setCustomEndState(e);
|
setCustomEndState(e);
|
||||||
setRangeState(r => {
|
setRangeState((r: TimeRange) => {
|
||||||
setCustomStartState(start => { persist(r, start, e); return start; });
|
setCustomStartState((start: string) => { persist(r, start, e); return start; });
|
||||||
return r;
|
return r;
|
||||||
});
|
});
|
||||||
}, []);
|
}, []);
|
||||||
|
|||||||
Reference in New Issue
Block a user