example:
import {useNavigate} from "react-router-dom";
navigate = useNavigate();
navigate("/login?redirect=shipping");
in the above routing function the code will not give the expected output as after the execution of isAuth check, it will redirect to /login/shipping and we don't that, so instead modify the code as follows.
import {useNavigate} from "react-router-dom";
navigate = useNavigate();
navigate("/login?redirect=/shipping");
Hi,
Route - Frontend/src/components/Cart/Cart.js
code: const checkoutHandler = () => { history.push("/login?redirect=shipping"); };
need to change the path to absolute path.
example: import {useNavigate} from "react-router-dom"; navigate = useNavigate(); navigate("/login?redirect=shipping");
in the above routing function the code will not give the expected output as after the execution of isAuth check, it will redirect to /login/shipping and we don't that, so instead modify the code as follows.
import {useNavigate} from "react-router-dom"; navigate = useNavigate(); navigate("/login?redirect=/shipping");
change - added a forward slash
Hope it helps Swapnil