Skip to content

Commit d45ba70

Browse files
committed
Use hash router and relative bundle path
1 parent a044613 commit d45ba70

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

examples/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<body>
1212
<div id="mount"></div>
13-
<script type="text/javascript" src="/bundle.js"></script>
13+
<script type="text/javascript" src="./bundle.js"></script>
1414
</body>
1515

1616
</html>

examples/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import ReactDOM from "react-dom";
3-
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
3+
import { HashRouter as Router, Route, Link, Redirect } from "react-router-dom";
44
import { Basic } from "./basic/basic";
55
import { Relative } from "./relative/relative";
66
import { Stacked } from "./stacked/stacked";
@@ -14,6 +14,7 @@ ReactDOM.render(
1414
<Link to="/basic">Basic</Link> <Link to="/relative">Relative</Link>{" "}
1515
<Link to="/stacked">Stacked</Link>
1616
</div>
17+
<Route exact path="/" render={() => <Redirect to="/basic" />} />
1718
<Route path="/basic" component={Basic} />
1819
<Route path="/relative" component={Relative} />
1920
<Route path="/stacked" component={Stacked} />

0 commit comments

Comments
 (0)