Unverified Commit add70dae authored by Max Hao's avatar Max Hao Committed by GitHub

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: 's avatarsamcx <sam@vercel.com>
parent b5fb1c11
...@@ -393,6 +393,8 @@ function Home() { ...@@ -393,6 +393,8 @@ function Home() {
export default Home export default Home
``` ```
<PagesOnly>
### With URL Object ### With URL Object
`Link` can also receive a URL object and it will automatically format it to create the URL string. Here's how to do it: `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: ...@@ -437,6 +439,8 @@ The above example has a link to:
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). 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).
</PagesOnly>
### Replace the URL instead of push ### Replace the URL instead of push
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: 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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment