go back to previous page in react js code example
Example 1: useHistory goback
import {useHistory} from "react-router-dom";
const history = useHistory();
<button onClick={() => history.goBack()}>Go Back</button>
Example 2: react router go rprevious page
directly use (()=>this.props.history.goBack())