typeScript promise 報錯但可過 求消除

假设要进行个流程

        this.processLoginAction()
        .then((userInfo) => this.firstProgress())
        .then((res) => this.secondProgress(res))
        .then(() => this.thirdProgress())
        .catch((err) => this.lastProgress(err))

thirdProgress的地方如下

private thirdProgress = (res) => new Promise((resolve, reject) => {
        resolve()
})

这里resolve没有回传值的话会有红底线,但如果给void的话 action就不会继续跑,请问有没有or的写法之类的让它不要报错?

有没有解啊?

new Promise<void>(...)

加void不會繼續跑阿哥…

resolve(null) 试试

new Promise<any>(...)

// @ts-ignore

正解!!!

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。