Skip to content

Instantly share code, notes, and snippets.

@santosh-btc
Last active June 24, 2018 12:16
Show Gist options
  • Save santosh-btc/db36b456163f1721e84093ec4625b448 to your computer and use it in GitHub Desktop.
Save santosh-btc/db36b456163f1721e84093ec4625b448 to your computer and use it in GitHub Desktop.
const renderField = ({
input,
type,
meta: { touched, error }
}) => (
<div>
<label>{label}</label>
<div>
<input {...input} placeholder={label} type={type} />
{touched && error && <span>{error}</span>}
</div>
</div>
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment