react-component-validation

React Component Validation ===============================


Keywords
react, components, validation, validator, redux
License
MIT
Install
npm install react-component-validation@0.2.1

Documentation

React Component Validation

Usage

This package provides two High Order Components (HOC) for validating a react component and transfering the errors from the component to store or its parent or anywhere you need.

  • WithValidation

    • It will start the composed component's validation.
    • Transfer the compouted validation properties ( eg: errors ) to store/parent/(anywhere you want).
    • It can reset component's validation properties.
  • AsValidator

    • Adds additional functionality in a component to act as the validator of its child components.
    • It maintains the child component's errors, in-progress validations.
    • Provides a function to get the child componets validation properties and pass this function to children as prop.
    • It will update all the child components validation properties to store/parent/(anywhere you want).

Example

In progress

Further Reading on HOC