Skip to content
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

🧐[问题] ant design pro v5 的app.js里面,怎么使用useMemo去监听路由地址变化? #9389

Closed
jmy1944311667 opened this issue Dec 8, 2021 · 3 comments

Comments

@jmy1944311667
Copy link

🧐 问题描述

我在v4使用useMeno去监听路由变化,判断是否有权限已经是否登录,但是我现在换到v5版本了,继续使用给我报错了,现在v5怎么写可以监听到路由呢?

💻 示例代码

🚑 其他信息

v4使用useMeno截图
image

v5截图
image

v5异常截图
image

@github-actions
Copy link

github-actions bot commented Dec 8, 2021

以下的 Issues 可能会帮助到你 / The following issues may help you

@jmy1944311667
Copy link
Author

以下的 Issues 可能会帮助到你 / The following issues may help you

这个没办法帮到我

@chenshuai2144
Copy link
Collaborator

方法里面不能用的 hooks的。
用这个事件好了

| onPageChange | 页面切换时触发 | (location: Location) => void | - |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants