我无法加载我的索引路径(Home组件),我真的很感激我的错误提供了一些帮助吗?
我的routes.js文件看起来像这样
module.exports = <Route
path="/"
getComponent={(location, cb) => {
require.ensure([], (require) => {
cb(null, require('./Container'))
})
}}
getChildRoutes={(location, cb) => {
require.ensure([], (require) => {
cb(null, require('./Container').childRoutes)
})
}}
getIndexRoute={(location, cb) => {
require.ensure([], (require) => {
cb(null, require('./Container').indexRoute)
})
}}
/>
我的Container.js文件看起来像这样
export default class Container extends Component {
render = () => {
return <div>
{this.props.children}
</div>
}
}
Container.childRoutes = [
<Route
path="/:product/get-quote"
component={props => <Product productName={props.params.product} {...props} />}
/>,
<Route
path="/:product/processing-quote"
component={props => <ProcessingQuote productName={props.params.product} {...props} />}
/>
]
Container.indexRoute = <IndexRoute component={Home} />