You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to make a custom array and arrayItem, because in my work I am required to use adminlte and I wanted to try this library, which forced me to make all the custom components, but I can not understand how to make an Array and an Array item, I have days and I do not have a clear idea. Might you help me? more specifically with GenField
The text was updated successfully, but these errors were encountered:
If you're looking to just extend one of the built in field types instead of having to implement it from scratch, you can do using function composition like this:
import{defaultFieldTypes}from'@isobar-us/redux-form-gen';importMyArrayComponentfrom'./MyArrayComponent';// your custom array componentconst{arrayType: defaultArrayType}=defaultFieldTypes;// your arrayType implementationconstarrayType=(options)=>{return{
...defaultArrayType(options),component: MyArrayComponent// your custom array component}}//...// mapping the type string (key) to the type definition (value)constcustomFieldTypes={array: arrayType};
If you have experience with redux-form, this library is used to generate fields for use with redux-form. For example, the array type uses the FieldArray under the hood, and you pass in a component prop just like you do in redux-form.
If you want me to go into more detail let me know what specific questions you have. Also, if you have an example of some code where you are stuck, you can create a codesandbox based on one of our templates here: Code Sandbox Templates. Then you can link to it in this issue. It really helps to have an example of what's not exactly clear. Thanks!
Hi, I am trying to make a custom array and arrayItem, because in my work I am required to use adminlte and I wanted to try this library, which forced me to make all the custom components, but I can not understand how to make an Array and an Array item, I have days and I do not have a clear idea. Might you help me? more specifically with GenField
The text was updated successfully, but these errors were encountered: