How to repair a 'TS2769: No overload matches this call'

后端 未结 2 2000
梦谈多话
梦谈多话 2021-01-04 10:50

After package updates, I suddenly get weird typescript errors:

[tsl] ERROR in C:..\\UI\\src\\sagas.ts(40,21) TS2769: No overload match

2条回答
  •  余生分开走
    2021-01-04 11:31

    I also met this problem, but I asked my colleague and learned about the following solution:

    redux-saga takes TakeableChannel. This is an action, so you declare type of loadIds's argument is shape of action like this:

    function* loadIds({
       forceReload
    }: { 
       type: string;
       forceReload: any; // your forceReload type
    }) {
       // your code
    }
    

提交回复
热议问题