-
Hi, how do i solve the typescript warning? const store = configureStore({
rootReducer,
middleware: (getDefaultMiddleware) => // < ts error here in `middleware` property
getDefaultMiddleware().concat(syncWithIDBMiddleware)
});
// Type 'Tuple<[ThunkMiddleware<any, UnknownAction>, ThunkMiddleware<any, UnknownAction>]>' is not assignable to type 'Tuple<[ThunkMiddleware<any, UnknownAction>]>'.
// Type '[ThunkMiddleware<any, UnknownAction>, ThunkMiddleware<any, UnknownAction>]' is not assignable to type '[ThunkMiddleware<any, UnknownAction>]'.
// Source has 2 element(s) but target allows only 1.ts(2322) I've done as explained here : https://redux.js.org/usage/usage-with-typescript#type-checking-middleware but there is no explanation that middleware expects single value tuple. |
Beta Was this translation helpful? Give feedback.
Answered by
skorphil
Jan 1, 2025
Replies: 1 comment
-
I got it. I needed to add reducer: rootReducer, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
skorphil
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got it. I needed to add
reducer
prop. And this also fixed ts warning