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

fix: React 16.13 warning #21702

Merged
merged 1 commit into from
Feb 29, 2020
Merged

fix: React 16.13 warning #21702

merged 1 commit into from
Feb 29, 2020

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Feb 29, 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

fix #21698

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Fix Form.Item get warning in react@16.13.0.
🇨🇳 Chinese 修复 Form.Item 在 react@16.13.0 会报警告的问题。

☑️ Self Check before Merge

  • 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

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Feb 29, 2020

setInlineErrors({
...inlineErrors,
[subName]: subErrors,
Promise.resolve().then(() => {
Copy link
Member

Choose a reason for hiding this comment

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

这样写相当于 setTimeout 么?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

上层 Form.Item 不在乎何时收到消息。所以顶层延迟掉。

Copy link
Contributor

Choose a reason for hiding this comment

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

那直接settimeout吧?

Copy link
Member Author

Choose a reason for hiding this comment

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

不用,消息通知越快越好。不用等 DOM render。

@codesandbox-ci
Copy link

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 e4ee20a:

Sandbox Source
antd reproduction template Configuration

@codecov
Copy link

codecov bot commented Feb 29, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #21702      +/-   ##
==========================================
+ Coverage   97.88%   97.88%   +<.01%     
==========================================
  Files         305      305              
  Lines        6998     6999       +1     
  Branches     1933     1887      -46     
==========================================
+ Hits         6850     6851       +1     
  Misses        148      148
Impacted Files Coverage Δ
components/form/FormItem.tsx 99.01% <100%> (ø) ⬆️

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 34c64e4...e4ee20a. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants