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:
Dominic Gannaway
2017-07-26 14:59:44 -07:00
committed by GitHub
parent 1f3de403bc
commit f92343159d
@@ -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);
};