跟着demo做的,文件:
const routerConfig = [
{
path : '/',
component : Main,
childrenRoutes: [
{path: 'about', component: About},
{path: 'inbox', component: Inbox}
]
},
{
path: '*',
component: Not
}
];
ReactDOM.render(
<Router routes={routerConfig} history={browserHistory}/>,
document.querySelector('#APP')
);
其他一切正常就是到/about和/inbox时会报404.。
代码写错了: