cra-location-hash-router:使用location.hash的CRA路由器

时间:2021-04-13 17:56:26
【文件属性】:
文件名称:cra-location-hash-router:使用location.hash的CRA路由器
文件大小:146KB
文件格式:ZIP
更新时间:2021-04-13 17:56:26
create-react-app cra location-hash TypeScript CRA location.hash路由器 在此存储库中,我使用URL片段验证了有关客户机+服务器路由解决方案的想法。 这个想法是针对您的SPA是通过文件服务器(例如GitHub Pages)提供SPA的情况,而您不能为index.html设置一个包罗万象的路由。 GitHub Pages具有404.html ,可被滥用以重定向到index.html ,但对于SEO索引返回具有404响应的内容不利。 该解决方案不会产生很好的URL,它依赖于octothorpe字符,但是它无需404就可以工作,并且易于在客户端实现。 去做 修复GitHub安全警报 为CRA设置GitHub Actions并用作GitHub Pages站点 在我的时候刷新CRA脚手架。
【文件预览】:
cra-location-hash-router-master
----.gitignore(310B)
----package.json(652B)
----package-lock.json(637KB)
----src()
--------react-app-env.d.ts(41B)
--------Link.tsx(400B)
--------Items.tsx(589B)
--------Home.tsx(393B)
--------Error.tsx(442B)
--------index.css(23B)
--------Item.tsx(470B)
--------index.tsx(161B)
--------App.tsx(794B)
----public()
--------index.html(443B)
--------favicon.ico(4KB)
----tsconfig.json(495B)
----README.md(896B)

网友评论