@flive/form-with-redux-form
v1.2.2
Published
This package exports Form from @flive/react-kit extended to be used with redux-form
Downloads
33
Readme
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.