xsnippet logotype

xsnippet

#362503, Untitled [ Diff ]

by Guest
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/src/routes.jsx b/src/routes.jsx
index e2b836b..1e823d8 100644
--- a/src/routes.jsx
+++ b/src/routes.jsx
@@ -1,5 +1,6 @@
 import React from 'react';
 import { Router, Route, IndexRoute, browserHistory } from 'react-router';
+import { useBasename } from 'history';

 import Main from 'Main';
 import TaskEdit from 'TaskEdit';
@@ -8,9 +9,14 @@ import CategoryWrapper from 'CategoryWrapper';
 import TaskAdd from 'TaskAdd';
 import TaskList from 'TaskList';

+
+function withBasename(history, baseuri) {
+  return useBasename(() => history)({ basename: baseuri })
+}
+
 const Routes = () => {
   return (
-    <Router history={browserHistory}>
+    <Router history={withBasename(browserHistory, '/dist')}>
       <Route path="/" component={Main}>
         <IndexRoute
           components={{