Skip to content

Commit

Permalink
docs: mention Link can be used for external links (#5212)
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber authored Jul 23, 2021
1 parent 7b2d45a commit b38c35a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions website/docs/docusaurus-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

External links also work, and automatically have these props: `target="_blank" rel="noopener noreferrer"`.

```jsx {2,7}
import React from 'react';
import Link from '@docusaurus/Link';
Expand All @@ -70,8 +72,7 @@ const Page = () => (
Check out my <Link to="/blog">blog</Link>!
</p>
<p>
{/* Note that external links still use `a` tags, but automatically opens in new tab. */}
Follow me on <a href="https://twitter.com/docusaurus">Twitter</a>!
Follow me on <Link to="https://twitter.com/docusaurus">Twitter</Link>!
</p>
</div>
);
Expand Down

0 comments on commit b38c35a

Please sign in to comment.