反应升级不兼容

时间:2016-03-01 15:12:05

标签: javascript reactjs

我为一些基于反应的移动应用设置了持续集成环境,在反应升级后,我收到了这个错误:

Uncaught Error: Invariant Violation: EventPluginRegistry: Cannot inject two different event plugins using the same name, `TapEventPlugin`.

你知道为什么会这样,以及如何解决它?

2 个答案:

答案 0 :(得分:2)

React v0.14.7和react-tap-event-plugin v0.2.2会发生这种情况。

要解决此问题,只需在应用中使用一次 react-tap-event-plugin lib,例如在主js文件中:

var tapEventPlugin = require("react-tap-event-plugin")();

答案 1 :(得分:1)

另一个答案是直接回答你的问题,但是,间接的答案是这个错误是由于你的CI当前正在更新你的依赖关系引起的,而且肯定不应该这样。

您可以通过锁定依赖关系来解决此问题,只有在您准备好或需要时才进行更新。