在Firebase中部署的React应用程序存在路由问题

zzzyeukh  于 2023-11-21  发布在  React
关注(0)|答案(1)|浏览(147)

这是我使用reactjs(https://orioncruz.site)开发的页面,它部署在firebase上。
当使用像https://orioncruz.site/casestudyhttps://orioncruz.site/process这样的自定义url时,会弹出一个firebase消息。
但我可以通过网站上的导航栏导航。
这是Github https://github.com/70Ni/orizoncruz的链接
在dev网络上,头请求总是转到https://orioncruz.site/

biswetbf

biswetbf1#

您需要通知firebase.json您的index.html是单页应用程序(SPA),因此您的react路由器将从那里开始
firebase.json**

"hosting": {
  "rewrites": [ {
    "source": "**",
    "destination": "/index.html"
   }],
}

字符串

相关问题