0
を使用しての使用history.push私は、単一ページのアプリケーションのWebページを持っているのに、なぜ私のページは以下 は私のコードの一部である...変更されることはありません...反応し、ルータを
var createBrowserHistory = require('history/lib/createBrowserHistory');
var history = createBrowserHistory();
history.push('account/person');
私はボタンをクリックしてくださいブラウザのURLがhttp://IP/account/personに変更されていますが、同じページには何も表示されません。
しかし、URLをhttp://IP/account/personに直接置き換えると、ページが正しいページにマップされます。以下は
は私はこれが起こったのはなぜ
<Router history={new createBrowserHistory()}>
<Route path='/account' component={Gift}></Route>
<Route path='/account/person' component={Person}></Route>
</Router>
ルータの設定を反応させているのですか?
は私達にあなたのルータの設定を表示します。 – azium
@azium、ルート設定を追加する – Dreams
はおそらく 'history.push'の代わりに' router.push() 'を使用します –