URLにパラメータがあるときにサイトを更新しようとすると、空白のページが表示されます。次のようにReact.jsでサイトを更新しても動作しません
私routes.jsファイルは次のとおりです。
私は http://localhost:8001/registrationすべてによconst routes = (
<Route path="/" component={App}>
<IndexRoute component={HomePage}/>
<Route path="registration/:id" component={hideIfLoggedIn(Registration)}/>
<Route path="registration" component={hideIfLoggedIn(Registration)}/>
<Route path="reset-password" component={PasswordReset} />
<Route path="portal" component={requireAuth(UserPage)} />
</Route>
);
は完璧に動作します。ページを更新すると問題なく動作します。
しかし、問題は私がhttp://localhost:8001/registration/step-oneにいるときです。初めて読み込むときにうまくいきますが、サイトを更新しようとすると空白のページが表示されます。あなたは、他のルートのindex
HTMLを提供するようにサーバーを構成する必要が
EDIT
gulp.task('connect', ['watch'], function() {
connect.server({
root: ['dist'],
port: config.port,
base: config.devBaseUrl,
livereload: true,
fallback: 'dist/index.html'
})
});
私は一口を使用し、一口に私が 'フォールバック持っているタスクを接続している:「DIST/index.html''を。私は私の質問を更新しました。 – Boky