better error message for React EventPlugin order check
Ran into this while inadvertently requiring multiple React versions in a separate project (`require('react');` vs `require('React');`
Jonas Gebhardt committed
Apr 21, 2014 at 15:41 UTC
01d41f6e18befb87d4c2abf3900178ea0dc9f0c9
2 files changed
+4
-2
src/event/EventPluginRegistry.js
+2
-1
@@ -176,7 +176,8 @@ var EventPluginRegistry = {
176
injectEventPluginOrder: function(InjectedEventPluginOrder) {
177
invariant(
178
!EventPluginOrder,
179
- 'EventPluginRegistry: Cannot inject event plugin ordering more than once.'
179
+ 'EventPluginRegistry: Cannot inject event plugin ordering more than ' +
180
+ 'once. You are likely trying to load more than one copy of React.'
181
);
182
// Clone the ordering so it cannot be dynamically mutated.
183
EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
src/event/__tests__/EventPluginRegistry-test.js
+2
-1
@@ -135,7 +135,8 @@ describe('EventPluginRegistry', function() {
135
EventPluginRegistry.injectEventPluginOrder(pluginOrdering);
136
}).toThrow(
137
'Invariant Violation: EventPluginRegistry: Cannot inject event plugin ' +
138
- 'ordering more than once.'
138
+ 'ordering more than once. You are likely trying to load more than one ' +
139
+ 'copy of React.'
140
);
141
});
142