score:0

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

score:2

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();

navigate('/detail')

Note:Written to update information.

score:59

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