0
子这里是我的JS斌演示:不能stopPropagation时呈现componentDidMount()
https://jsbin.com/baxipufozo/edit?html,js,output
我渲染DragDropChild
在DragDropParent componentDidMount
但是当我拖着孩子,家长触发dragstart
呢!
同样的问题click
事件
我试图e.stopPropagation()
e.nativeEvent.stopPropagation()
和e.nativeEvent.stopImmediatePropagation()
但他们都没有用
所以我不能stopPropagation时componentDidMount()渲染子,但我必须使孩子在didMount。
因为我正在重建一个旧项目.... – ReactNewbee