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
1 Answer
Reset to default 11Gatsby'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
版权声明:本文标题:javascript - How to Gatsby Link for 'mailto'? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742219608a2435204.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论