MDL和ReactJs:事件在componentHandler.upgradeDom()后丢失

问题描述:

我使用了React,并且在调用componentHandler.upgradeDom()时,所有被拒绝的元素上的注册事件都将丢失。MDL和ReactJs:事件在componentHandler.upgradeDom()后丢失

我在componentDidUpdate上手动调用componentHandler.upgradeDom()。

为了避免这种情况,我使用react-native-listener或在调用componentHandler.upgradeDom()后注册事件。

任何更好的解决方案?

+0

你如何在你的元素上注册事件?你可以使用codepen共享示例代码吗? :D –

+0

我无法在jsfiddle中重现...我将在我的应用上升级版本,也许没有问题 –

+0

我确认了最新版本的MD,没有丢失任何事件 –

使用最新版本的材料设计lite(1.0.6)时,在调用componentHandler.upgradeDom()时不会丢失事件。