react.js - React报错did not match any routes warning @ bundle.js:11780

查看:138
本文介绍了react.js - React报错did not match any routes warning @ bundle.js:11780的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

我按照react router的文档写了路由js

ReactDOM.render(

<div>
<SideBar/>
<Router history={browserHistory}>
    <Route path='/' component={SideBar}>
        <IndexRoute component={Home} />
        <Route path='about' component={About} />
        <Route path='features' component={Features} />
    </Route>
</Router>
</div>,
document.getElementById('app'));

打开index.html 应该加载SideBar和Home组件 结果加载不了Home 的Commoponet

请问问题出在哪里 感恩大神

解决方案

没有服务器 要用hashhistory 不能用browserhistory

这篇关于react.js - React报错did not match any routes warning @ bundle.js:11780的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆