Skip to content

Commit

Permalink
Adds a dummy function to assist react devtools to look for minification
Browse files Browse the repository at this point in the history
  • Loading branch information
ManasJayanth committed May 11, 2017
1 parent ffcbb0b commit dbd61db
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/renderers/dom/fiber/ReactDOMFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,19 @@ var ReactDOM = {
};

if (typeof injectInternals === 'function') {
// A dummy function to check for minification during runtime
// Refer https://github.com/facebook/react-devtools/issues/694#issuecomment-300535376
var dummyMinificationTestFn = function() {
if (__DEV__) {
var anotherDummyNoop = function() {};
anotherDummyNoop();
}
};

injectInternals({
findFiberByHostInstance: ReactDOMComponentTree.getClosestInstanceFromNode,
findHostInstanceByFiber: DOMRenderer.findHostInstance,
dummyMinificationTestFn: dummyMinificationTestFn,
// This is an enum because we may add more (e.g. profiler build)
bundleType: __DEV__ ? 1 : 0,
version: ReactVersion,
Expand Down

0 comments on commit dbd61db

Please sign in to comment.