Skip to content

Instantly share code, notes, and snippets.

@DreySkee
Last active January 31, 2017 00:06
Show Gist options
  • Save DreySkee/182c40d6631bb75a295a722444d5b6e8 to your computer and use it in GitHub Desktop.
Save DreySkee/182c40d6631bb75a295a722444d5b6e8 to your computer and use it in GitHub Desktop.
4 - Wordpress API + ReactJS
import React from 'react';
import {render} from 'react-dom';
import App from './components/App.js';
import Home from './components/Home.js';
import {
browserHistory,
IndexRoute,
Redirect,
Route,
Router
} from 'react-router';
class AppInitializer {
run() {
render(
<Router history={browserHistory}>
<Route path="/" component={ App } >
<IndexRoute component={ Home } />
</Route>
<Redirect from="*" to="/" />
</Router>
, document.getElementById('app')
);
}
}
new AppInitializer().run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment