From 9676ebbe3c0a414fe2155212d699ad7115490d10 Mon Sep 17 00:00:00 2001 From: Simen Fivelstad Smaaberg <66635118+simensma-fresh@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:35:16 +0000 Subject: [PATCH] Fix unkownaction typing --- services/common/src/redux/rootState.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/services/common/src/redux/rootState.ts b/services/common/src/redux/rootState.ts index 929b0970f4..28a043e061 100644 --- a/services/common/src/redux/rootState.ts +++ b/services/common/src/redux/rootState.ts @@ -1,5 +1,5 @@ import { sharedReducer } from "@mds/common/redux/reducers/rootReducerShared"; -import { configureStore, Dispatch } from "@reduxjs/toolkit"; +import { configureStore, Dispatch, UnknownAction } from "@reduxjs/toolkit"; import { loadingBarReducer } from "react-redux-loading-bar"; import type { TypedUseSelectorHook } from 'react-redux' @@ -24,8 +24,10 @@ export const store = getStore(); type RootState = ReturnType; -// Infer the `RootState` and `AppDispatch` types from the store itself + make sure redux-form actions are captured as well. -export type AppDispatch = typeof store.dispatch & Dispatch; +type AppAction = UnknownAction | FormAction; + +// Infer the `RootState` and `AppDispatch` types from the store itself + make sure redux-form acti are captured as well. +export type AppDispatch = typeof store.dispatch & Dispatch; export type AppStore = typeof store; // Use throughout your app instead of plain `useDispatch` and `useSelector`