用react-ts中使用redux和redux-thunk遇到无法dispatch异步action的问题

问题遇到的现象和发生背景

用react-ts中使用redux和redux-thunk遇到无法dispatch异步action的问题

问题相关代码,请勿粘贴截图
// 某一个组件里
const dispatch = useDispatch()
useEffect(() => {
    dispatch(getCodeImg())
    // 这一句报错!!!!!!
    // 类型“RootThunkAction”的参数不能赋给类型“AnyAction”的参数。
}, [])
// 异步action,thunk中间件
export const getCodeImg = (): RootThunkAction => (dispatch: Dispatch<ActionType>): void => {
  post_codeImage() // 一个axios请求
    .then(res => {
      const { data, code } = res.data
      if(code === 200) {
        dispatch(actionsCreator(codeImg, data.captchaImg))
        dispatch(actionsCreator(key, data.key))
      }
    })
}
// 一些类型定义
export type ActionType = {
  type: string,
  value?: unknown,
}
export type RootState = ReturnType<typeof store.getState>
export type RootThunkAction = ThunkAction<void, RootState, unknown, ActionType> 
// reducer函数,内容是传统的switch-case就不放了
const loginReducer = (state = inititalState, action: ActionType): LoginState => {}
我的解答思路和尝试过的方法

不明白问题在哪,是TS类型使用的问题还是Thunk在TS中使用的问题,求解!