diff --git a/plugins/home/src/homePageComponents/VisitedByType/Context.tsx b/plugins/home/src/homePageComponents/VisitedByType/Context.tsx index 0d1c2100f2..cd316d8b75 100644 --- a/plugins/home/src/homePageComponents/VisitedByType/Context.tsx +++ b/plugins/home/src/homePageComponents/VisitedByType/Context.tsx @@ -60,14 +60,15 @@ export const defaultContextValue: ContextValue = { export const Context = createContext(defaultContextValue); const getFilteredSet = - ( + ( setContext: Dispatch>, contextKey: keyof ContextValueOnly, ) => - (e: SetStateAction) => + (e: SetStateAction) => setContext(state => ({ ...state, - [contextKey]: typeof e === 'function' ? e(state[contextKey]) : e, + [contextKey]: + typeof e === 'function' ? (e as Function)(state[contextKey]) : e, })); export const ContextProvider = ({ children }: { children: JSX.Element }) => {