私は別のコンポーネントにページをリダイレクトしようとしていますが、私はdid not match any route
エラーを受け取ります。反応ルータがどのルートとも一致しません
"react-router": "2.4.0",
"react-router-redux": "4.0.4",
Webpack.configファイル:出力:
output: {
path: __dirname + '/dist',
publicPath: '/SurveyMaintenance/',
filename: 'bundle.js'
}
アプリの起動:
import {Router, browserHistory} from 'react-router';
import routes from './routes';
<Provider store={store}>
<Router history={browserHistory} routes={routes} />
</Provider>,
document.getElementById('app')
);
私Route.jsファイル:
<Route path="SurveyMaintenance/" component={App}>
<IndexRoute component={SurveyMaintenancePage}/>
<Route path="surveydetail/:id" component={EditSurveyPage} />
</Route>
はルータバージョンに反応します
リンク要素:
<Link to={`surveydetail/${survey.Id}`} onClick={editSurvey}></Link>
アドレスが正しいに見えるが、明らかにそのアドレスに割り当てられているコンポーネントがある場合、まだそのはこのエラーを投げます。 私は間違ったことをする必要があります。あなたは完全なパスを使用する必要があり、最後のスラッシュを必要としない、あなたもpublicPath: '/'
<Route path="SurveyMaintenance" component={App}>
<IndexRoute component={SurveyMaintenancePage}/>
<Route path="surveydetail/:id" component={EditSurveyPage} />
</Route>
設定する必要が
とき: ます。http:// localhostを:3000/SurveyMaintenance/SurveyMaintenance/surveydetail/449 – vineeth
更新の答えを参照してください、あなたはbasePathを設定する必要があります: '/' または反応ルータにベース名を追加してください – Kossel
待機していますが、URLが間違っています – vineeth