Update 03-linking-and-navigating.mdx (#55969)

I've removed a duplicated example.
This commit is contained in:
Abdulghane Jesry 2023-09-25 21:03:24 +03:00 committed by GitHub
parent 3dc2c1c7f8
commit 1d86a092ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'