redux form code example

Example 1: redux-form field type file

const file_upload= ({ input, type, meta: { touched, error, warning } }) => {
  delete input.value

  return (
    <div>
      <label htmlFor={input.name}>
        <input {...input} type={type}/>
      </label>
    </div>
  )
}

Example 2: redux form Field input prop

export default ({ input: { onChange, value }}) => (
  <input
    type="text"
    placeholder="Write something..."
    className="uk-input"
    onChange={onChange}
    value={value}
  />
);

Example 3: Redux form

import { Form } from 'redux-form' // ES6