mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Wrap "warning" call in DEV block to prevent PROD error (#10295)
* re-adds warning module to FB PROD bundle * Wrap the warning call too
This commit is contained in:
@@ -12,15 +12,15 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
if (__DEV__) {
|
||||
var warning = require('fbjs/lib/warning');
|
||||
}
|
||||
|
||||
import type {Fiber} from 'ReactFiber';
|
||||
import type {FiberRoot} from 'ReactFiberRoot';
|
||||
|
||||
declare var __REACT_DEVTOOLS_GLOBAL_HOOK__: Object | void;
|
||||
|
||||
if (__DEV__) {
|
||||
var warning = require('fbjs/lib/warning');
|
||||
}
|
||||
|
||||
let rendererID = null;
|
||||
let injectInternals = null;
|
||||
let onCommitRoot = null;
|
||||
@@ -36,7 +36,9 @@ if (
|
||||
} = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
injectInternals = function(internals: Object) {
|
||||
warning(rendererID == null, 'Cannot inject into DevTools twice.');
|
||||
if (__DEV__) {
|
||||
warning(rendererID == null, 'Cannot inject into DevTools twice.');
|
||||
}
|
||||
rendererID = inject(internals);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user