From 72f3ea7042fd9deb7e72ab36fdb03a7839248bdc Mon Sep 17 00:00:00 2001 From: Renan Mendes Carvalho Date: Wed, 20 Sep 2023 10:27:41 +0200 Subject: [PATCH] refactor(plugins/home): Remove any type Signed-off-by: Renan Mendes Carvalho --- .../home/src/homePageComponents/VisitedByType/Context.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 }) => {