Pass props through FieldArray
See original GitHub issueFeature
I have a view component for rendering an array of fields.
function createFormikArray({ title, initialValue }, renderItem) {
return function FormikArray({ name, form, ...arrayHepers }) {
return (
<React.Fragment>
{/* view that uses title, initialValue and renderItem props */}
</React.Fragment>
}
}
It would be very useful if I could do smth like that:
<FieldArray
name='users'
component={FormikArray}
title='My Field'
initialValue={{ firstname: '', lastname: '' }}
{/* and so on */}
/>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Passing extra props to component wrapped in FieldArray ...
When you create functional component with react your component accepts props as an argument. For example this piece of code is:
Read more ><FieldArray /> | Formik
<FieldArray /> is a component that helps with common array/list manipulations. You pass it a name property with the path to the key...
Read more >FieldArray - Redux Form
These are props that FieldArray will pass to your wrapped component. All the props provided to your component by redux-form are divided into...
Read more >React Formik Tutorial - 22 - FieldArray component - YouTube
React Formik Tutorial - 22 - FieldArray component ... Business - codevolution.business@gmail.com FieldArray component with Formik in React ...
Read more >FieldArrayRenderProps - React Form Component - Telerik
FieldArrayRenderProps. Represents the props that are passed to the component which is rendered by FieldArray. Name, Type, Default, Description ...
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 Free
Top 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
Any update on this? This is a feature that would be useful. We are passing a custom component to
FieldArray
, and passing props viaFieldArray
to our custom component allows us to adjust what renders. I see there’s an outstanding PR for it, but it hasn’t been updated since March.Also Field component passes props to underlying field Component
So I thought this will be ok for using the same logic for FieldArray, but it is not… it is really confusing