Skip to content

refactor: Form.Item with pure children will only render once #21991

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

Merged
merged 2 commits into from
Mar 8, 2020
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Mar 8, 2020

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

resolve #21987

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Refactor Form.Item render logic that will only render once when children is a pure component.
🇨🇳 Chinese 重构 Form.Item 渲染逻辑以使其子元素为纯组件时值变更只会渲染一次。

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

@tests-checker tests-checker bot left a comment

Choose a reason for hiding this comment

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

Could you please add tests to make sure this change works as expected?

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Mar 8, 2020

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 8, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 99d1cbc:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Mar 8, 2020

Codecov Report

Merging #21991 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21991      +/-   ##
==========================================
+ Coverage   97.93%   97.93%   +<.01%     
==========================================
  Files         306      306              
  Lines        7022     7030       +8     
  Branches     1934     1891      -43     
==========================================
+ Hits         6877     6885       +8     
  Misses        145      145
Impacted Files Coverage Δ
components/form/FormItem.tsx 99.13% <100%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76de873...99d1cbc. Read the comment docs.

@zombieJ zombieJ merged commit 9fdb82b into master Mar 8, 2020
@zombieJ zombieJ deleted the form-opt branch March 8, 2020 08:28
@afc163
Copy link
Member

afc163 commented Mar 8, 2020

#21976 有没有关系。

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.

4.0 Form.Item中rules中设置required,导致控件每次修改多次rerender
3 participants