Skip to content

Commit b20729d

Browse files
author
Ken Berkeley
committed
use hashHistory instead, thanks to @babeliao
1 parent adbf92c commit b20729d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/redux/store/syncHistoryWithStore.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
// 同步 history 配置
33
// ========================================================
44
import { useRouterHistory } from 'react-router'
5-
import createBrowserHistory from 'history/lib/createBrowserHistory'
5+
import createHashHistory from 'history/lib/createHashHistory'
66
import { routerMiddleware, syncHistoryWithStore } from 'react-router-redux'
77

8-
const browserHistory = useRouterHistory(createBrowserHistory)({
9-
basename: '' // 相当于 rootPath
8+
const browserHistory = useRouterHistory(createHashHistory)({
9+
basename: '', // 相当于 rootPath
10+
queryKey: false // 去除随机标识符
1011
})
1112

1213
export const historyMiddleware = routerMiddleware(browserHistory)

0 commit comments

Comments
 (0)