Skip to content

Commit

Permalink
Merge pull request BiosBoy#7 from BiosBoy/templater-routing
Browse files Browse the repository at this point in the history
added react-roter example integration
  • Loading branch information
BiosBoy authored Nov 16, 2018
2 parents 51426dd + 7080a33 commit d427b80
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/container/index.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import { PropTypes } from 'prop-types';
import React from 'react';
import { Provider } from 'react-redux';
import { Switch, Route } from 'react-router-dom';
import { ConnectedRouter } from 'connected-react-router';
import { Header, Footer, HelloWorld } from '../components';
import styles from '../styles/index.scss';

const AppContainer = ({ store, history }) => {
return (
<Provider store={store} history={history}>
<div className={styles.appWrapper}>
<Header />
<HelloWorld />
<Footer />
</div>
<ConnectedRouter history={history}>
<div className={styles.appWrapper}>
<Header />
<Switch location={location}>
<Route exact path='/' component={HelloWorld} />
</Switch>
<Footer />
</div>
</ConnectedRouter>
</Provider>
);
};
Expand Down

0 comments on commit d427b80

Please sign in to comment.