1.1.4 • Published 4 years ago

react-awesome-form-hook v1.1.4

Weekly downloads
11
License
MIT
Repository
github
Last release
4 years ago

React Awesome Form Hook

The hook makes form usage much easier

Installation

# using npm
npm install react-awesome-form-hook

# using yarn
yarn add react-awesome-form-hook

Example of Usage

Example of Options (in types)

type OptionsValue = {
  // required
  required: {
    value: boolean
    message: string
  },
  // max length
  max: {
    value: number,
    message: string
  },
  // min length
  min: {
    value: number,
    message: string
  },
  // pattern
  pattern: {
    value: RegExp,
    message: string
  },
  // custom function
  validate: {
    value: (value: string) => boolean,
    message: string
  }
}

type OptionsValue = {
  // required
  required: boolean,
  // max length
  max: number,
  // min length
  min: number,
  // pattern
  pattern: RegExp,
  // custom function
  validate: (value: string) => boolean
}

type Options = {
  firstName: CustomInputOptions,
  lastName: InputOptions
}
1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

5 years ago

0.0.5

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.4

5 years ago

0.0.1

5 years ago

1.0.0

5 years ago