Created
May 25, 2018 07:05
-
-
Save varun93/eaf2ab7e0e17862838e4ad1105f8cd8c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const genericFormHoc = ({handleFieldChange,form}) => { | |
const {fields} = form || {}; | |
const {submit} = form | |
return ( | |
<div> | |
{ | |
Object.keys(fields).map((fieldKey) => { | |
const {field} = fields[fieldKey]; | |
return <Field fieldKey={fieldKey} field={field} handleFieldChange={handleFieldChange} /> | |
}) | |
} | |
<Button {...submit} /> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment