0.2.1 • Published 8 years ago

react-component-validation v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

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