我正在使用React和Redux编写TypeScript应用程序,并且遇到问题。
我需要第二个默认选项。
代码如下:
import { ThunkAction } from 'redux-thunk'
type AppThunk<ActionTypes, ReturnType = void> = ThunkAction<
ReturnType,
AppStateType,
unknown,
ActionTypes
>
type ActionTypes = followUnfollowActionType | setUsersActionType | setTotalCountActionType |
setCurrentPageActionType | toggleIsFetchingActionType | toggleFollowingInProgressActionType
type ThunkType = AppThunk<ActionTypes>
错误:
Type 'ActionTypes' does not satisfy the constraint 'Action<any>'. TS2344
6 | AppStateType,
7 | unknown,
> 8 | ActionTypes
| ^
9 | >
这是什么问题?
答案 0 :(得分:0)
我已经找到了解决方法:
pixels_mutex