-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: export useMatchedRoute hook for theme #2165
Merged
PeachScript
merged 4 commits into
umijs:master
from
Wxh16144-forks:wuxh/refactor-router-hooks
Jul 26, 2024
Merged
feat: export useMatchedRoute hook for theme #2165
PeachScript
merged 4 commits into
umijs:master
from
Wxh16144-forks:wuxh/refactor-router-hooks
Jul 26, 2024
+37
−5
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Wxh16144
added a commit
to Wxh16144-forks/dumi-theme-antd-style
that referenced
this pull request
Jul 10, 2024
PeachScript
reviewed
Jul 10, 2024
docs/theme/api.md
Outdated
@@ -156,6 +156,28 @@ const Example = () => { | |||
}; | |||
``` | |||
|
|||
### useMatchRoute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
叫 useMatchedRoute 更好点?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈哈 我一开始也叫这个名字的,感觉太长了点
PeachScript
changed the title
feat: export
feat: export useMatchedRoute hook from theme api
Jul 12, 2024
useMatchRoute
feature hooks
PeachScript
changed the title
feat: export useMatchedRoute hook from theme api
feat: export useMatchedRoute hook for theme
Jul 12, 2024
arvinxx
pushed a commit
to arvinxx/dumi-theme-antd-style
that referenced
this pull request
Aug 6, 2024
* 🐛 fix: 修复页面白屏错误 * chore: fix lint * chore: update * chore: 更新说明 * chore: update wait: umijs/dumi#2165 * chore: update peerdeps * chore: re-import
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 这个变动的性质是?/ What is the nature of this change?
🔗 相关 Issue / Related Issue
fix: #2124
💡 需求背景和解决方案 / Background or solution
#1974 中对 useRouteMeta 返回结果进行了 Proxy , 并且在获取 texts 时抛出了一个 Promise
dumi-theme-antd-style 主题包在 https://github.com/arvinxx/dumi-theme-antd-style/blob/7d6977a374a21be7399492522439e8005a7f7fda/src/components/StoreUpdater/index.tsx#L74 处引用了,导致页面一直卡白屏(未处理 Promise).
主题侧准备 用 SWR 自定义获取 RouterMeta 但是需要获取当前 router.id 并通过 dumi 的
getRouteMetaById
方法获取 meta 信息。将逻辑提取为
useMatchedRoute
并对外暴露出来。📝 更新日志 / Changelog
useMatchedRoute
feature hooksuseMatchedRoute
hooks