New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: runtime-router 的文档有缺失 #5175
Labels
bug
Something isn't working
Comments
PR welcome😄 |
(其实后面的 basename 和 supportHistoryV5 就是前面说的具体配置 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
版本信息
问题详情
https://modernjs.dev/configure/app/runtime/router.html#runtimerouter
缺少相关配置
另外,我对路由方案的文档有一点小小的困惑
我的理解如下,有错误可以指出,modern-js 目前的路由方案分为 约定式路由、自控式路由、其他(自定义)
前提需开启
router: true
,约定src/routes
文件路由,可使用@modern-js/runtime/router
,自动注入 hoc前提需开启
router: true
,可使用@modern-js/runtime/router
,但是要自己在 App 根部包裹BrowserRouter
或RouteProvider
设置
router: false
,@modern-js/runtime/router
不会被打包进产物,自己安装react-router-dom
,自己注册BrowserRouter
或RouteProvider
所以我理解这一页的 basename 和 supportHistoryV5 是约定式路由的配置,也只有在约定式路由配置才生效,可以特殊标注一下
文档在路由方案-自控式路由的介绍稍微有点粗略,比较容易造成误解,甚至造成用户
react-router-dom
和@modern-js/runtime/router
多实例踩坑,需要手动 alias感觉文档这一方面可以做的更好,让用户有更多信息可供参考对这几种模式进行技术选型
复现链接
https://modernjs.dev/configure/app/runtime/router.html#runtimerouter
复现步骤
No need
The text was updated successfully, but these errors were encountered: