combineReducers doesn't infer type

前端 未结 2 1890
伪装坚强ぢ
伪装坚强ぢ 2021-01-15 05:27

I am using combineReducersin my React TypeScript app:

// combinedReducer.ts
import { combineReducers } from \'redux\'
import reducer1 from \'./r         


        
2条回答
  •  伪装坚强ぢ
    2021-01-15 06:03

    Ensure that Redux is at version 4.0.0 or higher. The type mappings for combineReducers was released with version 4.0.0, here's the related PR on the redux github.

    You can update your package.json file:

    ...
    "dependencies": {
       "redux": "^4.0.3"
    }
    ...
    

    Then run npm install to update to the latest version.

    Once you've made this change, make sure you restart your IDE to reload the type mappings.

提交回复
热议问题