React-on-Rails (5 절) 앱을 작성 중이며 문제가 있습니다. accounts/:account_id/letters/new
경로를 방문하면 React-Router는 EmailSendComponent
을 마운트 할 때 EmailShowComponent
을 마운트합니다.반응 라우터가 잘못된 구성 요소를 탑재합니다.
이 내 app.js 파일 : 나는 생성 관련 HTML 페이지의 각 내부 "<div id="app">"
태그를 배치 한
import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
$(function(){
ReactDOM.render(
<App />,
document.getElementById('app')
)
});
그리고이 내 main.js 파일이
<Router history={browserHistory}>
<Route path="/accounts/:id" component={AccountShowContainer} />
<Route path="/accounts/:account_id/letters/:id" component={EmailShowComponent} />
<Route path="/accounts/:account_id/letters/new" component={EmailSendComponent} />
</Router>
입니다 라우터에 대한 경로.
어떤 원인 일 수 있습니까?
당신의 루트의 순서를; '신'은 유효한 ID가 아닙니다. –