From 191f3c8b3fb61a7d66feff7730f50ce7e0d2dd19 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Sat, 5 Jul 2014 23:42:09 -0400 Subject: [PATCH] Export `window.React` so that the react-devtools can find it. The chrome tools first looks to see if `React` is defined globally, then if it's available via a call to `require()`. See https://github.com/facebook/react-devtools/blob/master/injected/ReactHost.js#L42-L48 --- templates/javascript/App.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/javascript/App.jsx b/templates/javascript/App.jsx index 83f17f7..f0771d8 100644 --- a/templates/javascript/App.jsx +++ b/templates/javascript/App.jsx @@ -7,6 +7,9 @@ var React = require('react/addons'); var ReactTransitionGroup = React.addons.TransitionGroup; +// Export React so the devtools can find it +(window !== window.top ? window.top : window).React = React; + // CSS require('../../styles/reset.css'); require('../../styles/main.css');