-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
fix: key type mismatch #691
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #691 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 27 27
Lines 721 722 +1
Branches 196 198 +2
=======================================
+ Hits 718 719 +1
Misses 3 3 ☔ View full report in Codecov by Sentry. |
src/utils/nodeUtil.tsx
Outdated
@@ -13,33 +13,35 @@ function convertItemsToNodes(list: ItemType[]) { | |||
if (opt && typeof opt === 'object') { | |||
const { label, children, key, type, ...restProps } = opt as any; | |||
const mergedKey = key ?? `tmp-${index}`; | |||
// The type of `key` changes, `eventKey` is the original value | |||
const mergeProps = { ...restProps, key: mergedKey, eventKey: mergedKey }; |
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.
...restProps 放后面比较匹配之前的效果
|
ref: ant-design/ant-design#47837