diff --git a/imgur-client/src/app.jsx b/imgur-client/src/app.jsx index 7974c49..6c5f3f2 100755 --- a/imgur-client/src/app.jsx +++ b/imgur-client/src/app.jsx @@ -1,42 +1,4 @@ var React = require('react'); -var ReactRouter = require('react-router'); -var HashHistory = require('react-router/lib/hashhistory'); -var Router = ReactRouter.Router; -var Route = ReactRouter.Route; +var Routes = require('./routes'); -var Hello = React.createClass({ - render: function() { - return

- {this.props.children} -

- } -}); - -var Child1 = React.createClass({ - render: function() { - return

- I'm child1 - {this.props.children} -

- } -}); - -var Child2 = React.createClass({ - render: function() { - return

I'm the other child, Child2.

- } -}) - -var routes = ( - - - - - - - - -) - -// var element = React.createElement(Hello, {}); -React.render(routes, document.querySelector('.container')); +React.render(Routes, document.querySelector('.container')); diff --git a/imgur-client/src/components/main.jsx b/imgur-client/src/components/main.jsx new file mode 100644 index 0000000..a3acede --- /dev/null +++ b/imgur-client/src/components/main.jsx @@ -0,0 +1,10 @@ +var React = require('react'); + +module.exports = React.createClass({ + render: function() { + return
+ I'm a header. + {this.props.children} +
+ } +}); diff --git a/imgur-client/src/routes.jsx b/imgur-client/src/routes.jsx new file mode 100644 index 0000000..7e3dbb8 --- /dev/null +++ b/imgur-client/src/routes.jsx @@ -0,0 +1,15 @@ +var React = require('react'); +var ReactRouter = require('react-router'); +var HashHistory = require('react-router/lib/hashhistory'); +var Router = ReactRouter.Router; +var Route = ReactRouter.Route; + +var Main = require('./components/main'); + +module.exports = ( + + + + + +)