Create a page where user will land after clicking on email link. That’s where you need to grab token from route params.
Use useParams hook to grab route params
// pages/auth/AccountActivate.js
import { useParams } from "react-router-dom";
import { useAuth } from "../../context/auth";
export default function AccountActivate() {
const { token } = useParams();
console.log(token);
return (
<div
className="display-1 d-flex justify-content-center align-items-center vh-100"
style={{ marginTop: "-5%" }}
>
Please wait...
</div>
);
}
Import in App.js
import AccountActivate from "./pages/auth/AccountActivate";
<Route
path="/auth/account-activate/:token"
element={<AccountActivate />}
/>