mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix TestUtils crash with NODE_ENV=production (#7246)
I caused it with #7189. We generally don’t recommend running TestUtils in production environment but this is technically a regression. Fixes #7231.
This commit is contained in:
@@ -410,9 +410,11 @@ NoopInternalComponent.prototype = {
|
||||
|
||||
var ShallowComponentWrapper = function(element) {
|
||||
// TODO: Consolidate with instantiateReactComponent
|
||||
this._debugID = nextDebugID++;
|
||||
var displayName = element.type.displayName || element.type.name || 'Unknown';
|
||||
ReactInstrumentation.debugTool.onSetDisplayName(this._debugID, displayName);
|
||||
if (__DEV__) {
|
||||
this._debugID = nextDebugID++;
|
||||
var displayName = element.type.displayName || element.type.name || 'Unknown';
|
||||
ReactInstrumentation.debugTool.onSetDisplayName(this._debugID, displayName);
|
||||
}
|
||||
|
||||
this.construct(element);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user