Last active
June 16, 2017 17:37
-
-
Save DreySkee/6a325a8f0c107264efb34919dee41a2e to your computer and use it in GitHub Desktop.
9 - Wordpress API + ReactJS (Updated)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {render} from 'react-dom'; | |
import DataActions from 'flux/actions/DataActions.js'; | |
import Home from 'components/Home.js'; | |
import { | |
BrowserRouter as Router, | |
Route, | |
Redirect, | |
Switch | |
} from 'react-router-dom'; | |
class AppInitializer { | |
run() { | |
DataActions.getPages((response)=>{ | |
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