I am new to react using react bootstrap table to show the list of customers and click on the each row should take back to the detail view. I am looking a way to go back to the list view from detail page. How can I achieve that?
Asked
Active
Viewed 4,847 times
-1
-
that go back will be on which action? some "go back" button or something else? – Mayank Shukla Mar 29 '18 at 15:57
-
Go back button <=> something like "site list view" – ssl Mar 29 '18 at 16:00
-
use `this.props.history.goBack()` in onClick handler, it will navigate to previous page. – Mayank Shukla Mar 29 '18 at 16:02
1 Answers
0
Working Solution:
react-router (v4) how to go back?
constructor(props){
super(props);
this.goBack = this.goBack.bind(this); // i think you are missing this
}
goBack(){
this.props.history.goBack();
}
.....
<button onClick={this.goBack}>Go Back</button>

ssl
- 115
- 1
- 10