Click in order · Next.js course · Module 2: Routing and Layouts
usePathname Syntax in a Component
Arrange the usePathname syntax in a component
Items to click
- { usePathname }
- import
- 'use client'
- 'next/navigation'
- const pathname = usePathname()
- from
Show the answer
Correct order:
- 'use client'
- import
- { usePathname }
- from
- 'next/navigation'
- const pathname = usePathname()