arrow_backBACK TO DRILLS
Blue BeltnextjsPREMIUM
The URL That Became [object Object]
Clicking this button is supposed to navigate to a profile URL with query parameters.
REACT_MODULE // 0x42
'use client';
import { useRouter } from 'next/navigation';
export default function ProfileLink({ userId, tab }) {
const router = useRouter();
const goToProfile = () => {
router.push({ userId, tab });
};
return <button onClick={goToProfile}>View Profile</button>;
}Instead, the browser navigates to a URL ending in the literal text "[object Object]". Why?