arrow_backBACK TO DRILLS
Blue BeltnextjslockPREMIUM

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?

lock

This Drill is Locked

This is a premium drill. Continue on to the next free drill in the sequence.

CONTINUE DRILLarrow_forward
BugDojo
BlogFAQ

© 2026. Carved in code.