Update 03-linking-and-navigating.mdx (#55969)
I've removed a duplicated example.
This commit is contained in:
parent
3dc2c1c7f8
commit
1d86a092ad
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ export default function PostList({ posts }) {
|
||||||
|
|
||||||
You can use [`usePathname()`](/docs/app/api-reference/functions/use-pathname) to determine if a link is active. For example, to add a class to the active link, you can check if the current `pathname` matches the `href` of the link:
|
You can use [`usePathname()`](/docs/app/api-reference/functions/use-pathname) to determine if a link is active. For example, to add a class to the active link, you can check if the current `pathname` matches the `href` of the link:
|
||||||
|
|
||||||
```tsx filename="app/components/links.tsx"
|
```tsx filename="app/components/links.tsx" switcher
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
|
@ -95,7 +95,7 @@ export function Links() {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```jsx filename="app/components/links.jsx"
|
```jsx filename="app/components/links.js" switcher
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
|
|
Loading…
Reference in a new issue