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
chore: clarify error about children of Form.Item with name
#38038
Conversation
This is a common error and the message as written was not very clear. This should be more helpful pointing people in the right direction
Referring to "render props" is confusing because the docs don't explain what that is, and it's not really a prop.
Also improve the test names for some
Missed a couple messages
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #38038 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 444 444
Lines 8231 8217 -14
Branches 2488 2491 +3
=========================================
- Hits 8231 8217 -14
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
components/form/FormItem/index.tsx
Outdated
warning( | ||
false, | ||
'Form.Item', | ||
'A `Form.Item` with a `name` prop must have a single child element. For information on how to render more complex form items, see https://ant.design/components/form/#components-form-demo-complex-form-control.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I've opened a PR to add a couple links for these error messages, I'll update this PR when that is merged 👍
name
name
…ign#38038) * Clarify error about children of Form.Item with `name` This is a common error and the message as written was not very clear. This should be more helpful pointing people in the right direction * Update error message in test * Clarify more error messages Referring to "render props" is confusing because the docs don't explain what that is, and it's not really a prop. * Update tests for new error messages Also improve the test names for some * Further test message updates Missed a couple messages * Add short URLs * Update test error messages * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Ell Bradshaw <joelbr@tailormed.co> Co-authored-by: afc163 <afc163@gmail.com>
…ign#38038) * Clarify error about children of Form.Item with `name` This is a common error and the message as written was not very clear. This should be more helpful pointing people in the right direction * Update error message in test * Clarify more error messages Referring to "render props" is confusing because the docs don't explain what that is, and it's not really a prop. * Update tests for new error messages Also improve the test names for some * Further test message updates Missed a couple messages * Add short URLs * Update test error messages * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Ell Bradshaw <joelbr@tailormed.co> Co-authored-by: afc163 <afc163@gmail.com>
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
No issue directly related, but this issue is indirectly about it: #25150
💡 Background and solution
Existing message is confusingly phrased in English, and doesn't really describe the problem or how to fix it.
📝 Changelog
☑️ Self-Check before Merge