0
import React from 'react';
import { IndexRoute, Router, Route, hashHistory } from 'react-router';
import Home from './containers/Home';
import App from './containers/App';
export default (
<Router history={hashHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home}/>
</Route>
</Router>
);
import React, { Component } from 'react';
import {Background} from '../App/App.style'
class App extends Component {
render() {
return (
<div>
{this.props.children}
{console.log(this.props.children)}
</div>
);
}
}
export default App;
我想首頁組件作爲組件應用程序的 一個孩子,而不是使用IndexRoute什麼在routerV4
這些代碼有什麼選擇?反應路由器V4子組件
請提供有關該問題的更多詳細信息... –