Skip to content

Instantly share code, notes, and snippets.

@zomars
Created August 29, 2018 21:17
Show Gist options
  • Save zomars/63c41c20433c7707473d87a89e78f3fc to your computer and use it in GitHub Desktop.
Save zomars/63c41c20433c7707473d87a89e78f3fc to your computer and use it in GitHub Desktop.
Render redux-form Fields component
const renderFields = fields =>
Object.keys(fields).map((name, i) => {
if (!fields[name].input) return null;
return (
<Grid item xs={12}>
<Field
key={name}
name={name}
label={fields.labels[i]}
{...fields[name]}
type="text"
/>
</Grid>
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment