【发布时间】:2020-04-07 11:54:55
【问题描述】:
ReactDOM.render(
<HashRouter>
<Switch>
<Switch>
<Route path="/" render={props => <Index {...props} />} />
<Redirect to="/" />
<Route
path="/staking"
render={props => <LandingPage {...props} />}
/>
<Redirect from="/" to="/index" />
</Switch>
</Switch>
</HashRouter>,
document.getElementById("root")
);
我的网址呈现为http://localhost:3000/staking#/
我必须为 github 页面使用 hashrouter。
我的链接如下
<NavLink to="/staking">
<a href="/staking">
<i className="now-ui-icons business_bank"></i>
<p>Staking</p>
</a>
</NavLink>react,h
我无法让它显示除索引之外的其他页面。
【问题讨论】:
-
但是但是你在你的索引路由之后有重定向:)`
` :)
标签: reactjs