feat: improve key type to support React.Key#692
Open
madocto wants to merge 1 commit intoreact-component:masterfrom
Open
feat: improve key type to support React.Key#692madocto wants to merge 1 commit intoreact-component:masterfrom
madocto wants to merge 1 commit intoreact-component:masterfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #692 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 27 27
Lines 721 721
Branches 196 198 +2
=======================================
Hits 718 718
Misses 3 3 ☔ View full report in Codecov by Sentry. |
crazyair
reviewed
Mar 22, 2024
| className?: string; | ||
| } | ||
|
|
||
| export type MenuKey = React.Key; |
Contributor
There was a problem hiding this comment.
这个好不容易是 string 了,又要改会 key 吗,如果要改,改成 T 吧
Contributor
There was a problem hiding this comment.
里面包含 number,如果我想执行处理字符串的方法,还需要转一次字符串
Contributor
Author
There was a problem hiding this comment.
还是希望 string | number 都能支持,并且输入的类型和输出的类型一致,如果合并了 #692 ,那 React.Key 默认是不是就支持了?
Member
There was a problem hiding this comment.
范型 +1,React.Key 有时会包含奇怪的东西,让用户自己指定 key 类型比较好
There was a problem hiding this comment.
React.Key is the type used in the dependency rc-menu
Line 54 in f94aec3
key prop, I feel this type should follow the dependency type instead of forcing string
This file contains hidden or 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
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.
ref: ant-design/ant-design#47837