Explain how to use the useRouter hook in Next.js for programmatic navigation.
Instruction: Discuss the useRouter hook in Next.js and how it can be used for programmatic navigation within an application.
Context: This question assesses the candidate's knowledge of the useRouter hook in Next.js and its application for navigating programmatically without using Link components.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
I would first identify the router. In the App Router, useRouter comes from next/navigation in a Client Component and provides methods such as push, replace, and refresh...