mirror of
https://github.com/react-webpack-generators/generator-react-webpack.git
synced 2025-12-08 18:01:59 +00:00
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
34 lines
769 B
JavaScript
34 lines
769 B
JavaScript
/**
|
|
* @jsx React.DOM
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
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');
|
|
|
|
var imageURL = '../../images/yeoman.png';
|
|
|
|
var <%= scriptAppName %> = React.createClass({
|
|
render: function() {
|
|
return (
|
|
<div className='main'>
|
|
<ReactTransitionGroup transitionName="fade">
|
|
<img src={imageURL} />
|
|
</ReactTransitionGroup>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
React.renderComponent(<<%= scriptAppName %> />, document.getElementById('content')); // jshint ignore:line
|
|
|
|
module.exports = <%= scriptAppName %>;
|