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.Item renderProps 第一次 render 无法获取字段的问题 #25280

Open
1 task
zombieJ opened this issue Jun 29, 2020 · 4 comments
Open
1 task

Form.Item renderProps 第一次 render 无法获取字段的问题 #25280

zombieJ opened this issue Jun 29, 2020 · 4 comments
Labels
🐛 Bug Ant Design Team had proved that this is a bug. Inactive

Comments

@zombieJ
Copy link
Member

zombieJ commented Jun 29, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

first render

What is expected?

first render with value

What is actually happening?

first render without value

Environment Info
antd 4.3.5
React latest
System IOS
Browser chrome

Form.Item 在 didMount 时注册,这使得同步注册的 Form.Item renderProps 在字段注册事前 render 存在时序问题。

@USTCLX
Copy link

USTCLX commented Mar 7, 2022

Hi. @zombieJ I noticed that this issue was put forward in 2020, which is quite a long time ago. Is there any plan to fix this bug?

@devuxer
Copy link

devuxer commented Apr 15, 2022

Translation of the subject: Form.Item renderProps can't get the field in the first render

This is affecting me too.

I get do getFieldsValue(true), but then I lose type safety because it return any instead of Values.

@alienzhangyw
Copy link

form.getFieldsValue(true) don't return the initialValues in Form props after calling form.resetFields() with all fields untouched

@f-code-maker
Copy link

f-code-maker commented Jul 25, 2022

form.getFieldsValue()在第一次渲染时。不能正常获取到initialvalue的值, 如果这个formitem的内容是在抽屉中,在第二次点开抽屉的时候,才能正常获取到initialvalue的值。例子 :https://codesandbox.io/s/ji-ben-shi-yong-antd-4-21-7-forked-6bnobg?file=/demo.js
这个首次渲染的问题 啥时候才能修复🤔 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. Inactive
Projects
None yet
Development

No branches or pull requests

7 participants