0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

React-routerで直前のパスに戻す

Posted at

結論

this.props.history.goBack()

これでOK

どういう事ができるの?

例えば複数のページに固定されたリンク(ヘッダーからモーダルを開くなど)を実装した際にモーダルを閉じたときに前のページに遷移させて
ユーザーの手間を省くことができる。

recommends-6-2.gif

こういう小さな知識でユーザーの使い勝手が変わるので日々勉強するの大事ですね。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?