-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Form.useWatch support selector #6461
Conversation
PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6461.surge.sh |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## feature #6461 +/- ##
===========================================
- Coverage 92.36% 92.08% -0.29%
===========================================
Files 307 316 +9
Lines 6617 6857 +240
Branches 1636 1717 +81
===========================================
+ Hits 6112 6314 +202
- Misses 470 505 +35
- Partials 35 38 +3 ☔ View full report in Codecov by Sentry. |
))} | ||
</> | ||
) | ||
return <>{childNode}</> |
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.
这个还要 Fragment 吗?
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.
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.
要升级 typescript 版本吗
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.
as 一下好了
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.
好了
fb1c4e7
to
5038f45
Compare
src/components/form/utils.ts
Outdated
namePathList: NamePath[] | ||
): Store { | ||
let newStore = {} | ||
namePathList.forEach(namePath => { |
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.
这里是不是用 reduce 更方便些
const newStore = namePathList.reduce((accumulator, currentValue) => {
const value = getValue(store, toArray(currentValue));
return setValue(accumulator, toArray(currentValue), value);
}, {});
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.
参考的这个 https://github.com/react-component/field-form/blob/09a8dd9c6694323f67ba7007f014dd19e3c3bf61/src/utils/valueUtil.ts#L19 本来要直接引用的,怕 fc-form 改,就拿过来了
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.
感觉也不错~
@zombieJ 怎么样了 |
No description provided.