Skip to content

Commit

Permalink
added react router
Browse files Browse the repository at this point in the history
  • Loading branch information
manojsinghnegiwd committed Sep 3, 2017
1 parent 4ea638b commit db21eb8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';

// main app
import App from './containers/App';
// main routes
import AppRoutes from './routes';

import { Provider } from 'react-redux';
import store from './store';

ReactDOM.render(
<Provider store={store}>
<App />
<AppRoutes />
</Provider>,
document.getElementById('app')
)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-redux": "^5.0.6",
"react-router-dom": "^4.2.2",
"react-router-redux": "^4.0.8",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0",
Expand Down
15 changes: 15 additions & 0 deletions routes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import { BrowserRouter, Route, Switch, Link } from 'react-router-dom';
import App from './containers/App';
import About from './containers/About';

export default () => {
return (
<BrowserRouter>
<Switch>
<Route exact path='/' component={App}/>
<Route path='/about' component={About}/>
</Switch>
</BrowserRouter>
)
}

0 comments on commit db21eb8

Please sign in to comment.