嗨我有这样的反应组件与路线。当我转到localhost:8000
时,它会正确加载A组件,但是当我尝试localhost:8080/broute
时,它会无法正常工作。
我怎样才能让它发挥作用?
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, Link, browserHistory, IndexRoute, hashHistory } from 'react-router'
import A from './components/A.jsx'
import B from './components/B.jsx'
ReactDOM.render((
<Router history = {browserHistory}>
<Route path = "/" component = {A}>
<IndexRoute component = {A}/>
<Route path = "broute" component = {B} />
</Route>
</Router>
), document.getElementById('app'))