My react router push isn’t redirecting to Home component, while I’m passing with props the Home path. It seems that the code is correct though.
import React, { Component } from "react";
const ErrorLogin = () => {
let back = () => {
this.props.history.push("/");
};
return (
<div className="wrapper">
<h1>Error</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris
</p>
<button onClick={() => back()}>Back</button>
</div>
);
};
export default ErrorLogin;