1
React-router似乎使用JSX进行配置。React路由器配置
似乎配置也可以在JavaScript中直接完成(简单地?)。
他们使用JSX是因为它更清晰还是还有其他一些好处?
例子:
ReactDOM.render(
<Router history={hashHistory}>
<Route path="/" component={Layout}>
<IndexRoute component={Featured}></IndexRoute>
...
</Route>
</Router>
);