Skip to content

Instantly share code, notes, and snippets.

@DreySkee
Last active June 16, 2017 17:33
Show Gist options
  • Save DreySkee/25c729c74e94f80afae286649c7f4292 to your computer and use it in GitHub Desktop.
Save DreySkee/25c729c74e94f80afae286649c7f4292 to your computer and use it in GitHub Desktop.
5 - Wordpress API + ReactJS (Updated)
import {render} from 'react-dom';
import Home from 'components/Home.js';
import {
BrowserRouter as Router,
Route,
Redirect,
Switch
} from 'react-router-dom';
class AppInitializer {
run() {
render(
<Router>
<div>
<Switch>
<Route path="/" component={ Home } exact />
<Route render={() => { return <Redirect to="/" /> }} />
</Switch>
</div>
</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