Ajout history externe

This commit is contained in:
wpetit 2020-02-25 11:44:05 +01:00
parent 6621e81e17
commit 4d4a4a8744
3 changed files with 11 additions and 4 deletions

View File

@ -7,12 +7,14 @@ import { ConnectedLoginPage as LoginPage } from './pages/login';
import DashBoardClient from './pages/DashBoardClient';
import DashBoardDev from './pages/DashBoardDev';
import { ConnectedLogoutPage as LogoutPage } from './pages/logout';
import { connect } from 'react-redux';
import { history } from './util/history';
class App extends Component {
export class App extends Component {
render () {
return (
<Fragment>
<HashRouter>
<HashRouter history={history}>
<Switch>
<Route path='/login' exact component={LoginPage} />
<Route path='/logout' exact component={LogoutPage} />
@ -27,4 +29,6 @@ class App extends Component {
}
}
export default hot(module)(App)
export const ConnectedApp = connect()(App);
export const HotApp = hot(module)(ConnectedApp);

View File

@ -1,5 +1,5 @@
import ReactDOM from 'react-dom'
import App from './app'
import { HotApp as App } from './app'
import { configureStore } from './store/store'
import { Provider } from 'react-redux'
import 'bulma/css/bulma.min.css';

View File

@ -0,0 +1,3 @@
import { createBrowserHistory } from 'history';
export const history = createBrowserHistory();