mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
committed by
Paul O’Shannessy
parent
4c199daa26
commit
01d41f6e18
@@ -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.'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user