Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

RN:0.61.4
antd:@ant-design/react-native 3.3.0

代码:

   Modal.alert( "错误", "错误信息", [{ text: '确定' }])

我RN + ANTD 在二级页面 Modal.alert() 在不关闭alert的情况下 滑动返回了上一页 结果alert在一级页面也还在,请问这个问题有人遇到过吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

Modal.alert()挂载的节点一般是<body></body>,和路由的根节点是并列关系,因此当路由变化时,只是路由节点内部的dom发生改变,而弹窗不会关闭


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...