Commit 7c139a43 by Arjun Jhukal

route redirection solution

parent 65cc4e7e
"use client" "use client"
import { useParams, useRouter } from "next/navigation"; import { useParams, useRouter } from "next/navigation";
import { useEffect } from "react";
export default function TryspeedRoot() { export default function TryspeedRoot() {
const { slug } = useParams(); const { slug } = useParams();
const route = useRouter() const router = useRouter();
console.log(slug)
useEffect(() => {
if (slug) { if (slug) {
route.replace(`/buy-coins/${slug}/success`) console.log(slug);
router.replace(`/buy-coins/${slug}/success`);
} }
return null }, [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