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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix FormItem hooks render error #22053

Merged
merged 1 commit into from Mar 10, 2020
Merged

fix: fix FormItem hooks render error #22053

merged 1 commit into from Mar 10, 2020

Conversation

kagawagao
Copy link
Contributor

@kagawagao kagawagao commented Mar 10, 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

馃挕 Background and solution

set name property for FormItem which has no name been set before will cause React hooks render error
image

if (!hasName && !isRenderProps && !dependencies) {
return renderLayout(children);
}
// Record for real component render
const updateRef = React.useRef(0);
updateRef.current += 1;

Edit antd reproduction template

declare updateRef hook in advance can fix this bug

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English
馃嚚馃嚦 Chinese

鈽戯笍 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

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Mar 10, 2020

components/form/FormItem.tsx Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 10, 2020

Codecov Report

Merging #22053 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22053   +/-   ##
=======================================
  Coverage   97.96%   97.96%           
=======================================
  Files         306      306           
  Lines        7039     7039           
  Branches     1937     1938    +1     
=======================================
  Hits         6896     6896           
  Misses        143      143
Impacted Files Coverage 螖
components/form/FormItem.tsx 99.13% <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 122b218...aa3aee3. Read the comment docs.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 10, 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 582e57bc5bcb6780701a20e625f5b43b073a331b:

Sandbox Source
antd reproduction template Configuration
antd reproduction template PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 10, 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 aa3aee3:

Sandbox Source
antd reproduction template Configuration
antd reproduction template PR

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.

None yet

3 participants