using useParams Url = 2323
import { useParamsrams } from 'next/navigation';
const uParams = useParams ()
<p>{uParams.clientside}</p>
Use usePathname() to get the current route path.
'use client'
import { usePathname } from 'next/navigation';
const Component = () => {
const pathname = usePathname();
console.log(pathname);
return <div>{pathname}</div>;
};
Name Param: zohaib
useSearchParams() is used to read query strings on the client side.
import { useSearchParams } from 'next/navigation';
const search = useSearchParams();
console.log(search.toString()); // Converts to a string
console.log(search.get('name')); // Get specific query param
const name = search.get('name');