Skip to content

Instantly share code, notes, and snippets.

import React, { Component } from 'react';
import { reduxForm, Field } from 'redux-form';
import { Form, Button, Label, Input } from 'semantic-ui-react';
const CustomInput = ({ input, meta: { error, touched }, label, ...custom }) => (
<Form.Field error={error && touched}>
<label htmlFor={custom.name} >{label}</label>
<Input id={custom.name} {...input} {...custom} />
{error && touched && <Label basic color="red" pointing>{error}</Label>}
</Form.Field>