mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-18 19:46:57 +02:00
docs: mention Link can be used for external links (#5212)
This commit is contained in:
parent
7b2d45a439
commit
b38c35a36d
1 changed files with 3 additions and 2 deletions
|
@ -60,6 +60,8 @@ This component enables linking to internal pages as well as a powerful performan
|
||||||
|
|
||||||
The component is a wrapper around react-router’s `<Link>` component that adds useful enhancements specific to Docusaurus. All props are passed through to react-router’s `<Link>` component.
|
The component is a wrapper around react-router’s `<Link>` component that adds useful enhancements specific to Docusaurus. All props are passed through to react-router’s `<Link>` component.
|
||||||
|
|
||||||
|
External links also work, and automatically have these props: `target="_blank" rel="noopener noreferrer"`.
|
||||||
|
|
||||||
```jsx {2,7}
|
```jsx {2,7}
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import Link from '@docusaurus/Link';
|
import Link from '@docusaurus/Link';
|
||||||
|
@ -70,8 +72,7 @@ const Page = () => (
|
||||||
Check out my <Link to="/blog">blog</Link>!
|
Check out my <Link to="/blog">blog</Link>!
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
{/* Note that external links still use `a` tags, but automatically opens in new tab. */}
|
Follow me on <Link to="https://twitter.com/docusaurus">Twitter</Link>!
|
||||||
Follow me on <a href="https://twitter.com/docusaurus">Twitter</a>!
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue