相关疑难解决方法(0)

React-router"无法GET/*",但根网址除外

我愿意为我的应用程序使用React-router,我正在尝试首先在doc中给出的示例,我在下面复制了它.现在,当我去localhost:3000/,我看到"App"按预期,但每隔一页,如localhost:3000/inbox返回"无法获取/收件箱".我在这里错过了什么?

var About = React.createClass({
  render: function () {
    return <h2>About</h2>;
}});

var Inbox = React.createClass({
  render: function () {
    return <h2>Inbox</h2>;
}});

var App = React.createClass({
  render () {
    return (
      <div><h1>App</h1>
        <RouteHandler/>
      </div>
)}});

var routes = (
  <Route path='/' handler={App}>
    <Route path="about" handler={About}/>
    <Route path="inbox" handler={Inbox}/>
  </Route>
);
Run Code Online (Sandbox Code Playgroud)

reactjs react-router

26
推荐指数
2
解决办法
3万
查看次数

标签 统计

react-router ×1

reactjs ×1