Type Definition wrong for Child Renderer of Form.Item
See original GitHub issue- I have searched the issues of this repository and believe that this is not a duplicate.
Reproduction link
Steps to reproduce
<Form.Field shouldUpdate >
{(form) => {
// this is then undefined according to type definition but holds the item path to access the element!
console.log(form.prefixName)
// type should be from https://github.com/react-component/field-form/blob/e118381c2102b36c4ffe7e17a6415df091e772b7/src/interface.ts#L233
return (
<Form.Field name="fun" hidden={form.getFieldValue([...form.prefixName, 'other'])}>
<Input />
</Form.Field>
)
}}
</Form.Field>
What is expected?
the type for the passed form should include the prefixName property
What is actually happening?
the prefixName property is accessible but not defined in the type
Environment | Info |
---|---|
antd | 4.15.3 |
React | 17.0.2 |
System | OSX |
Browser | Chrome |
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
React: how to use child FormItem components without getting ...
I have tried to remove the <Form> </Form> tags in my child component, but then it is a compile error. Is there a...
Read more >NForm: Nested Forms: Child Forms - GitHub Pages
In this tutorial we use the material renderer. The material renderer does not render child forms, instead it renders an edit button which...
Read more >lightning-record-edit-form - Salesforce Developers
Use the lightning-record-edit-form component to create a form that's used to add a Salesforce record or update fields in an existing record on...
Read more >The Button element - HTML: HyperText Markup Language
If the button is a submit button, this Boolean attribute specifies that the form is not to be validated when it is submitted....
Read more >Typechecking With PropTypes - React
With PropTypes.element you can specify that only a single child can be passed to a component as children. import PropTypes from 'prop-types'; class...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
by now it is no longer possible to get the context as in https://github.com/ant-design/ant-design/issues/30529#issuecomment-850272255.
Is there any other way to do this?