Closed imhxc closed 3 years ago
Hello @imhxc, we use GitHub issues to trace bugs or discuss plans of Umi. So, please don't ask usage questions here. You can try to open a new discussion in umi discussions, select Q&A
to ask questions.
你好 @imhxc,Umi Issue 板块是用于 bug 反馈与需求讨论的地方。请勿询问如何使用的问题,你可以试着在 umi discussions 新开一个 discussion,选择 Q&A
类别进行提问。
umi 使用 dva 时的 history 是传入的,和传给 react-router 的是同一个。
What happens?
众所周知,在
dva
中,通过如下方式可以配置history
:同时,在
react-router-dom
v5 版本中,history
的获取只能通过useHistory
获得:所以,如何在实例化的时候,就能将 useHistory 获取的 history 对象传递给 dva?
umi 如何实现的?
我看了
umi
的源码,发现 useHistory 就是直接导出的react-router-dom
v5 中的 hooks,而且 dva 也是用的目前版本的 dva。所以,想问一下,umi 是如何实现的?