Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
496 views
in Technique[技术] by (31.9m points)

antd Modal.alert() 无法关闭的问题,求解决

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

代码:

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

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (31.9m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...