@salsita/react-forms

Install this package with npm

Usage no npm install needed!

<script type="module">
  import salsitaReactForms from 'https://cdn.skypack.dev/@salsita/react-forms';
</script>

README

react-forms

Install

Install this package with npm

npm i @salsita/react-forms

or yarn

yarn add @salsita/react-forms

API

Modules

FormValidations

Functions

formsReducer(state, action)FormsState

The reducer of the forms module

FormFieldSelect(props)

A form field component for select

FormField(props)

A form field component for input

Interfaces

FormFieldSelectProps
FormFieldProps

FormValidations

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