ant-design / ant-design-mobile-rn

Ant Design for React Native
https://rn.mobile.ant.design/
MIT License
3.04k stars 612 forks source link

Toast.loading中onClose回调无法执行 #1195

Closed HuXin957 closed 2 years ago

HuXin957 commented 3 years ago

Reproduction link

https://github1s.com/ant-design/ant-design-mobile-rn/blob/HEAD/components/toast/ToastContainer.tsx#L59

Steps to reproduce

Toast.loading('xx',0,()=>console.log('hello')) Toast.removeAll()

What is expected?

在调用Toast.removeAll()时能正常输出 “hello”

What is actually happening?

没有执行回调

Environment Info
antd 4.2.0
React 16.8
System ios
Browser 14.x

链接中第59行,1、loading方法的duration传0 会进不了判断。2、通过remove或removeAll 关闭loading时,我认为回调应该放在关闭loading的方法中,目前异步使用loading时无法执行回调