i used history.goBack("/signup") not history.push("/signup") seems to work for me .


Now using useNavigate() hook instead of useHistory() or anything related to history.

You can use like this;

import { useNavigate } from "react-router-dom";

let navigate = useNavigate();


Note:Written to update information.


I actually just found my problem, and it might be yours too.

I was on react-router-dom@5.2.0 and history@5.0.0.

react-router 5x is compatible with history 4x. Once I downgraded to history@4.10.1 everything started working.

Related Query

More Query from same tag