Skip to content

Commit add70da

Browse files
maxhaomhsamcx
andauthored
Docs: Make "With URL Obeject" only displayed in Pages docs (#65547)
App router [does not support](https://nextjs.org/docs/messages/app-dir-dynamic-href) dynamic hrefs: removing it from the app router docs, and only having it in the pages router docs. Fixes #65505 --------- Co-authored-by: samcx <sam@vercel.com>
1 parent b5fb1c1 commit add70da

File tree

1 file changed

+4
-0
lines changed
  • docs/02-app/02-api-reference/01-components

1 file changed

+4
-0
lines changed

docs/02-app/02-api-reference/01-components/link.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,8 @@ function Home() {
393393
export default Home
394394
```
395395

396+
<PagesOnly>
397+
396398
### With URL Object
397399

398400
`Link` can also receive a URL object and it will automatically format it to create the URL string. Here's how to do it:
@@ -437,6 +439,8 @@ The above example has a link to:
437439

438440
You can use every property as defined in the [Node.js URL module documentation](https://nodejs.org/api/url.html#url_url_strings_and_url_objects).
439441

442+
</PagesOnly>
443+
440444
### Replace the URL instead of push
441445

442446
The default behavior of the `Link` component is to `push` a new URL into the `history` stack. You can use the `replace` prop to prevent adding a new entry, as in the following example:

0 commit comments

Comments
 (0)