@flive/form-with-redux-form

1.2.2 • Public • Published

form-with-redux-form

This module exports Form fields and inputs from @flive/react-kit and extends them to handle redux-form.

Install

npm install @flive/form-with-redux-form

Usage

Unlike @flive/react-kit, inputs and fields are directly exported, they are not subcomponents of Form in this module.

import React from 'react';
import { Field } from 'redux-form';
import { TextField } from '@flive/form-with-redux-form';

const EmailField = props => (
  <Field
    component={TextField}
    label="Email"
    name="email"
  />
);

Available

Inputs

  • Input
  • TextInput
  • NumberInput
  • PasswordInput
  • TextareaInput
  • SelectInput
  • CheckboxInput
  • RadioInput

Fields

  • TextField
  • PasswordField
  • NumberField
  • TextareaField
  • SelectField
  • CheckboxField
  • CheckboxesField
  • RadiosField

Hocs

  • withReduxFormInput
  • withReduxFormField

Ref forwarding with inputRef

If you want to forward a ref to the input, we provide the prop inputRef.

import React from 'react';
import { Field } from 'redux-form';
import { TextareaInput } from '@flive/form-with-redux-form';

const ref = React.createRef();

const DescriptionField = props => (
  <Field
    inputRef={ref}
    component={TextareaInput}
    label="Description"
    name="description"
  />
);

License

This project is licensed under a custom license. See the LICENSE file for details.

Readme

Keywords

none

Package Sidebar

Install

npm i @flive/form-with-redux-form

Weekly Downloads

11

Version

1.2.2

License

SEE LICENSE IN LICENSE

Unpacked Size

45.9 kB

Total Files

8

Last publish

Collaborators

  • robnriks
  • cgrimal
  • damien-s
  • lbdremy