Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
$ = jQuery = require('jquery');
var React = require('react');
var Home = require('./components/homePage');
var About = require('./components/about/aboutPage');
var App = React.createClass({
render: function() {
var Child;
switch (this.props.route) {
case 'about':
Child = About;
Child = Home;
return (
<Child />
function render() {
var route = window.location.hash.substr(1);
React.render(<app route={route} />, document.getElementById('app'));
window.addEventListener('hashchange', render);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.