简体   繁体   English

如何将反应网站链接到非反应 href?

[英]How to link a react website to non-react href?

I have a portfolio where I need to link my projects, some of which are built using react.我有一个作品集,我需要在其中链接我的项目,其中一些项目是使用 React 构建的。 Now the portfolio is built using just html,css,and js.现在,作品集仅使用 html、css 和 js 构建。

How can I link href="" of one of the links to that react project's index.html, cuz I can't simply use the index.html file from src folder of react or the from the build folder?我如何将其中一个链接的 href="" 链接到该反应项目的 index.html,因为我不能简单地使用反应的 src 文件夹或构建文件夹中的 index.html 文件?

Just use an anchor tag .只需使用anchor tag The Link from react-router is for Single-Page Application, underneath the hood if prevents the page from refreshing itself.来自 react-router 的链接用于单页应用程序,如果阻止页面自行刷新,则在引擎盖下。

<a href="/APageThatUsesReact."file_ext"' />

A universal anchor will also do.通用锚也可以。

function UniversalAnchor({ path }) {
  return <a href=`domain/thisGlobal/${path}` />
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM