Skip to content

Commit 15eb6a5

Browse files
committed
fix: share dashboard history instance
1 parent 1575f10 commit 15eb6a5

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import createHistory from 'history/createBrowserHistory'
2+
3+
const history = createHistory()
4+
5+
export default history

frontend/pages/dashboard/index.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@ import 'core-js/stable'
33
import 'regenerator-runtime/runtime'
44
import React from 'react'
55
import ReactDOM from 'react-dom'
6-
import createHistory from 'history/createBrowserHistory'
76
import AppContainer from './AppContainer'
87
import AppStore from './redux/store'
98
import routes from './routes'
10-
11-
const history = createHistory()
9+
import history from './history'
1210

1311
const renderApp = (id, props = {}) => {
1412
const ROOT_DOM = document.getElementById(id)

frontend/pages/dashboard/redux/store/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { createStore, applyMiddleware } from 'redux'
33
import thunk from 'redux-thunk'
44
import { createLogger } from 'redux-logger'
55
import { routerMiddleware } from 'react-router-redux'
6-
import { browserHistory } from 'react-router'
6+
import history from '../../history'
77

88
import appReducer from '../reducer'
99

1010
export const createAppStore = (initialState = {}) => {
1111
const logger = createLogger()
12-
const router = routerMiddleware(browserHistory)
12+
const router = routerMiddleware(history)
1313

1414
const mids = [
1515
thunk

0 commit comments

Comments
 (0)