I am trying to pass a price object through the next Link.
I keep getting undefined in the console. I have went through the docs and still am getting undefined. Code will be down below. I will also need help retrieving the price object on the calendar page.
Here is the console log of price for the PricingCard.jsx Console Log Here
PricingCard.jsx
<Link href={{
pathname: '/calendar',
query: {price: price.id}
}} >
<button
className="mt-8 flex w-full justify-center rounded-md border border-transparent bg-[#f1592a] py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"
>
{" "}
Schedule Today
</button>
</Link>
calendar page
import { useRouter } from "next/navigation";
export default function Calendar() {
const router = useRouter();
const price = router.query;
console.log(price);
I am getting an undefined on the console.log on the calendar page.
Any help would be appreciated.