Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/renderers/shared/fiber/ReactFiberDevToolsHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ let rendererID = null;
let injectInternals = null;
let onCommitRoot = null;
let onCommitUnmount = null;

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

warning(
(testMinification.name || testMinification.toString())
.indexOf('testMinification') !== -1,
"It looks like you're using a minified copy of the development build " +
'of React. When deploying React apps to production, make sure to use ' +
'the production build which skips development warnings and is faster. ' +
'See https://fb.me/react-minification for more details.',
);

if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.supportsFiber
Expand All @@ -35,7 +53,7 @@ if (

injectInternals = function(internals: Object) {
warning(rendererID == null, 'Cannot inject into DevTools twice.');
rendererID = inject(internals);
rendererID = inject(Object.assign({}, internals, {testMinification}));
};

onCommitRoot = function(root: FiberRoot) {
Expand Down