Skip to content

Commit

Permalink
Upsell dev tools
Browse files Browse the repository at this point in the history
People probably don't know these exist. Add some information about React
dev mode as well as a link to the developer tools when using Chrome.
  • Loading branch information
Pete Hunt authored and zpao committed Jan 11, 2014
1 parent bcacd17 commit d8a8f6a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/core/React.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ var React = {
}
};

if (__DEV__) {
var ExecutionEnvironment = require('ExecutionEnvironment');
if (ExecutionEnvironment.canUseDOM &&
navigator.userAgent.indexOf('Chrome') > -1) {

This comment has been minimized.

Copy link
@cpojer

cpojer Jan 11, 2014

Contributor

Would it be too crazy to inject a magical variable into the page from React devtools and not show this message if you have the devtools installed? Personally I just get annoyed if something always shows up and I can't do anything against it. Think about the message jewel never getting cleared.

This comment has been minimized.

Copy link
@cpojer

cpojer Jan 11, 2014

Contributor

window.__DONT_TOUCH_THIS_OR_YOU_WILL_GET_FIRED__ = true; :D

console.debug(
'Download the React DevTools for a better development experience: ' +
'http://fb.me/react-devtools'
);
}
}

// Version exists only in the open-source version of React, not in Facebook's
// internal version.
React.version = '0.9.0-alpha';
Expand Down

0 comments on commit d8a8f6a

Please sign in to comment.