[英]Next.js: Calling Thunks in getServerSideProps with next-redux-wrapper with TypeScript?
[英]Redux toolkit typescript type issue with next js and next-redux-wrapper
我在这里按照 redux 工具包的设置为下一个 js 设置。 但是,在原始问题的tsconfig.json
中, compilerOptions.strict = false
而我的是true
。 我遇到的问题在store.js
中。 如果你看演示,当调用configureStore
时,reducer 有以下问题:
Type '(state: ReturnType<typeof combinedReducer>, action: AnyAction) => any' is not assignable to type 'Reducer<CombinedState<{ counter: CounterState; kanyeQuote: KanyeState; }>, AnyAction> | ReducersMapObject<CombinedState<{ counter: CounterState; kanyeQuote: KanyeState; }>, AnyAction>'.
任何帮助表示赞赏。
您可以将reducer
定义更改为
const reducer: typeof combinedReducer = (state, action) => {
那么它会工作得很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.