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');`
This commit is contained in:
Jonas Gebhardt authored and Paul O’Shannessy committed 2014-04-21 15:42:25 -07:00
1 parent 4c199daa26
commit 01d41f6e18
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -176,7 +176,8 @@ var EventPluginRegistry = {
injectEventPluginOrder: function(InjectedEventPluginOrder) {
invariant(
!EventPluginOrder,
'EventPluginRegistry: Cannot inject event plugin ordering more than once.'
'EventPluginRegistry: Cannot inject event plugin ordering more than ' +
'once. You are likely trying to load more than one copy of React.'
);
// Clone the ordering so it cannot be dynamically mutated.
EventPluginOrder = Array.prototype.slice.call(InjectedEventPluginOrder);
@@ -135,7 +135,8 @@ describe('EventPluginRegistry', function() {
EventPluginRegistry.injectEventPluginOrder(pluginOrdering);
}).toThrow(
'Invariant Violation: EventPluginRegistry: Cannot inject event plugin ' +
'ordering more than once.'
'ordering more than once. You are likely trying to load more than one ' +
'copy of React.'
);
});