how to push url of the previous page react code example
Example 1: react router go rprevious page
directly use (()=>this.props.history.goBack())
Example 2: react router last page
import { useHistory } from "react-router-dom";
function demo () {
let history = useHistory();
const goToPreviousPath = () => {
history.goBack()
}
return (
<div>
<Button
onClick={goToPreviousPath}
>
Back
</Button>
</div>
):
}