import React from 'react'
import { Router, Route, IndexRoute, hashHistory } from 'react-router'
import Frame from '../layouts/Frame'
import Home from '../views/Home'
import Detail from '../views/Detail'
const routes = (
<Router history={hashHistory}>
<Route path="/" component={Frame} />
<IndexRoute component={Home} />
<Route path="/detail:id" component={Detail} />
</Router>
)
export default routes
Warning: [react-router] An <IndexRoute> does not make sense at the root of your route config
IndexRoute组件里的Home组件是正常的,单独拿出来也能显示,实在不清楚报错的原因
陪伴而非守候
相关分类