const {id}=useParams()
vs
in next js
interface Props {
id:any;
}
const func=({id}:Props)=>{
}
const {id}=useParams()
vs
in next js
interface Props {
id:any;
}
const func=({id}:Props)=>{
}
useParams() converts your component to a client component while defining an interface keeps your component as a server component.
interface Props {
params: {
id: string
}
}
thank you for answering