We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9f8a38 commit 54ec6a8Copy full SHA for 54ec6a8
modules/hashHistory.js
@@ -1,5 +1,15 @@
1
import useRouterHistory from './useRouterHistory'
2
import createHashHistory from 'history/lib/createHashHistory'
3
4
-export default useRouterHistory(createHashHistory)()
+const canUseDOM = !!(
5
+ typeof window !== 'undefined' && window.document && window.document.createElement
6
+)
7
+
8
+let history
9
10
+if (canUseDOM) {
11
+ history = useRouterHistory(createHashHistory)()
12
+}
13
14
+export default history
15
0 commit comments