【问题标题】:Linking between pages in Astro with React使用 React 在 Astro 中的页面之间链接
【发布时间】:2022-08-03 02:58:03
【问题描述】:

我正在尝试将 Astro 与 react 一起使用。

Astro 使用类似于 next 或 remix 的内置路由系统。

我找不到任何类型的 <Link>component 可以在 next 或 remix 中使用。

我是否应该集成 react-router 以在页面之间正确路由?这在某种程度上违背了他们内置路由系统的目的

    标签: reactjs astrojs


    【解决方案1】:

    不完全正确,根据文档,Astro 使用锚标签链接到页面。如here 所见,因此您可以继续在 pages 目录中将它们链接在一起,它应该可以正常工作!

    <a href="/about/">
    

    搏一搏!

    【讨论】:

      猜你喜欢
      • 2022-01-18
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 1970-01-01
      • 2011-08-21
      • 1970-01-01
      • 1970-01-01
      • 2016-02-20
      相关资源
      最近更新 更多