admin管理员组

文章数量:1327849

I'm making a blog with gatsby but, the Link doesn't work for mailto

Hhere is my codes. It brings me to http://localhost:8000/mailto:[email protected]
I want to use this Link for external.

<Link to='mailto:[email protected]'></Link>

I'm making a blog with gatsby but, the Link doesn't work for mailto

Hhere is my codes. It brings me to http://localhost:8000/mailto:[email protected]
I want to use this Link for external.

<Link to='mailto:[email protected]'></Link>

Share Improve this question edited Jan 21, 2021 at 5:57 Ferran Buireu 29.3k7 gold badges46 silver badges72 bronze badges asked Jan 1, 2021 at 13:02 ho-sho-s 892 silver badges11 bronze badges 3
  • maybe this helps – InspectorGadget Commented Jan 1, 2021 at 13:06
  • Thanks, but i dont wanna use plugin. Isn't there another way? – ho-s Commented Jan 1, 2021 at 13:09
  • 2 The Gatsby <Link /> ponent is for linking between pages within your site. For external links to pages not handled by your Gatsby site, use the regular HTML <a> tag. check out here – InspectorGadget Commented Jan 1, 2021 at 13:15
Add a ment  | 

1 Answer 1

Reset to default 11

Gatsby's <Link> ponent extends from the @reach/router (from React) and it's intended to use only for internal navigation. From Gatsby's documentation:

The Gatsby <Link /> ponent is for linking between pages within your site. For external links to pages not handled by your Gatsby site, use the regular HTML <a> tag.

In your case, since you're not using any kind of internal navigation, you should use a regular <a> tag, you can't use the <Link> ponent. Use:

<a href='mailto:[email protected]'>Your text</a>

本文标签: javascriptHow to Gatsby Link for 39mailto39Stack Overflow