StackBlitz 演示
我在這里按照下一個 js 的 redux 工具包的設定。但是,在原始問題中tsconfig.json,compilerOptions.strict = false而我的是true. 我遇到的問題在store.js. 如果你看demo,呼叫時configureStorereducer有以下問題:
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>'.
任何幫助表示贊賞。
uj5u.com熱心網友回復:
您可以將reducer定義更改為
const reducer: typeof combinedReducer = (state, action) => {
那么它會作業得很好。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/407291.html
標籤:
