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

Form.useWatch support selector #6461

Closed
wants to merge 8 commits into from

Conversation

crazyair
Copy link
Member

No description provided.

@crazyair crazyair changed the base branch from master to feature November 30, 2023 07:36
Copy link
Contributor

PR preview has been successfully built and deployed to https://antd-mobile-preview-pr-6461.surge.sh

Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Attention: 54 lines in your changes are missing coverage. Please review.

Comparison is base (9d0edaa) 92.36% compared to head (f01584b) 92.08%.
Report is 34 commits behind head on feature.

Files Patch % Lines
...ents/calendar-picker-view/calendar-picker-view.tsx 89.79% 14 Missing and 1 partial ⚠️
src/components/calendar-picker/calendar-picker.tsx 67.64% 9 Missing and 2 partials ⚠️
src/components/image-uploader/image-uploader.tsx 93.44% 7 Missing and 1 partial ⚠️
src/components/dropdown/dropdown.tsx 86.66% 5 Missing and 1 partial ⚠️
src/components/tabs/tabs.tsx 70.00% 6 Missing ⚠️
...ponents/calendar-picker-view/arrow-left-double.tsx 0.00% 3 Missing ⚠️
src/components/calendar-picker-view/arrow-left.tsx 0.00% 3 Missing ⚠️
src/components/popover/popover-menu.tsx 0.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

))}
</>
)
return <>{childNode}</>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个还要 Fragment 吗?

Copy link
Member Author

@crazyair crazyair Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

去掉了
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要升级 typescript 版本吗

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as 一下好了

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好了

namePathList: NamePath[]
): Store {
let newStore = {}
namePathList.forEach(namePath => {
Copy link
Contributor

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);
}, {});

Copy link
Member Author

@crazyair crazyair Dec 1, 2023

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 改,就拿过来了

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉也不错~

@crazyair
Copy link
Member Author

@zombieJ 怎么样了

@crazyair crazyair closed this May 17, 2024
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

Successfully merging this pull request may close these issues.

3 participants