1.0.0 • Published 7 years ago
@salsita/react-forms v1.0.0
react-forms
Install
Install this package with npm
npm i @salsita/react-forms
or yarn
yarn add @salsita/react-forms
API
Modules
Functions
Interfaces
FormValidations
- FormValidations
- .isEmail(value) ⇒ string | undefined
- .notEmptyString(message) ⇒ function
- .notEmptyObject(message) ⇒ function
FormValidations.isEmail(value) ⇒ string | undefined
Validates an email address
Kind: static method of FormValidations
Returns: string | undefined - An error message
Param | Type | Description |
---|---|---|
value | string | undefined | The input value |
FormValidations.notEmptyString(message) ⇒ function
Creates a validation function that checks if the input value is not an empty string
Kind: static method of FormValidations
Returns: function - The validation function
Param | Type | Description |
---|---|---|
message | string | The error message |
FormValidations.notEmptyObject(message) ⇒ function
Creates a validation function that checks if the input value is not an empty object
Kind: static method of FormValidations
Returns: function - The validation function
Param | Type | Description |
---|---|---|
message | string | The error message |
FormFieldSelectProps
Kind: global interface
Properties
Name | Type | Description |
---|---|---|
label | string | Label of the field |
FormFieldProps
Kind: global interface
Properties
Name | Type | Description |
---|---|---|
type | string | Input type |
label | string | Label of the field |
formsReducer(state, action) ⇒ FormsState
The reducer of the forms module
Kind: global function
Param | Type | Description |
---|---|---|
state | FormsState | The state of redux-form |
action | Action | A redux action |
FormFieldSelect(props)
A form field component for select
Kind: global function
Param | Type | Description |
---|---|---|
props | FormFieldSelectProps | Properties |
FormField(props)
A form field component for input
Kind: global function
Param | Type | Description |
---|---|---|
props | FormFieldProps | Properties |
1.0.0
7 years ago