我正在反应中创建一个应用程序,我正在使用反应路由器4。
我的路由如下:
<BrowserRouter>
<div id="main-container">
<header id="main-header">
<TopBar />
<MainMenu {...this.props} />
</header>
<section id="main-content" className="content">
<Route exact path="/" render={() => (
<Start {...this.props} />
)} />
<Route path='/404' component={NotFound404} />
<Route exact path="/mytenders" render={() => (
<MyTenders {...this.props} />
)} />
<Route exact path="/mytenders/tender:tenderId" render={( match ) => (
<Tender {...this.props} match={match}/>
)} />
<Route exact path="/mytenders/tender:tenderId/chapter:chapterId" render={( match ) => (
<Chapter {...this.props} match={match}/>
)} />
<Route exact path="/othertenders" render={() => (
<OthersTenders {...this.props} />
)} />
<Route exact path="/recycled" render={() => (
<Bin {...this.props} />
)} />
</section>
</div>
</BrowserRouter>
一切似乎都运行良好,但是当我尝试访问/ mytenders / tender3 / chapter1时,我的控制台出现了404错误:
GET http://localhost:3006/mytenders/tender3/chapter1 404 (Not Found)
但是如下图所示,一切都已加载......
我知道有些事情发生了,因为我似乎无法从这个页面保存到我的数据库。