Commit 7c139a43 by Arjun Jhukal

route redirection solution

parent 65cc4e7e
"use client"
import { useParams, useRouter } from "next/navigation";
import { useEffect } from "react";
export default function TryspeedRoot() {
const { slug } = useParams();
const route = useRouter()
console.log(slug)
if (slug) {
route.replace(`/buy-coins/${slug}/success`)
}
return null
}
const router = useRouter();
useEffect(() => {
if (slug) {
console.log(slug);
router.replace(`/buy-coins/${slug}/success`);
}
}, [slug, router]);
return null;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment