Ajout history externe
This commit is contained in:
parent
6621e81e17
commit
4d4a4a8744
@ -7,12 +7,14 @@ import { ConnectedLoginPage as LoginPage } from './pages/login';
|
|||||||
import DashBoardClient from './pages/DashBoardClient';
|
import DashBoardClient from './pages/DashBoardClient';
|
||||||
import DashBoardDev from './pages/DashBoardDev';
|
import DashBoardDev from './pages/DashBoardDev';
|
||||||
import { ConnectedLogoutPage as LogoutPage } from './pages/logout';
|
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 () {
|
render () {
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<HashRouter>
|
<HashRouter history={history}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path='/login' exact component={LoginPage} />
|
<Route path='/login' exact component={LoginPage} />
|
||||||
<Route path='/logout' exact component={LogoutPage} />
|
<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);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import App from './app'
|
import { HotApp as App } from './app'
|
||||||
import { configureStore } from './store/store'
|
import { configureStore } from './store/store'
|
||||||
import { Provider } from 'react-redux'
|
import { Provider } from 'react-redux'
|
||||||
import 'bulma/css/bulma.min.css';
|
import 'bulma/css/bulma.min.css';
|
||||||
|
3
frontend/src/util/history.js
Normal file
3
frontend/src/util/history.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import { createBrowserHistory } from 'history';
|
||||||
|
|
||||||
|
export const history = createBrowserHistory();
|
Loading…
Reference in New Issue
Block a user