Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jurassix/react-validation-mixin

Simple validation mixin (HoC) for React.
https://github.com/jurassix/react-validation-mixin

Last synced: about 2 months ago
JSON representation

Simple validation mixin (HoC) for React.

Awesome Lists containing this project

README

        

# react-validation-mixin
_Simple validation library for React._

This library simply wraps your React Component, transferring it props containing the boilerplate to validate a React form.

**react-validation-mixin** aims to provide a low-level toolkit for _React.Component_ validation, relying on existing validation libraries.

This library currently supports at least two strategies and the community is urged to expand the available strategies. Each strategy is responsible for the data validation and error message responses. A complete list of strategies can be found at [the end of this page](#strategies).

Users of the library are required to install and include the mixin and a chosen strategy.

---

### [View the Demo](http://jurassix.github.io/react-validation-mixin/)

### [Read the Documentation](http://jurassix.gitbooks.io/docs-react-validation-mixin/content/overview/index.html)

### [Steps for migrating from 4.x](http://jurassix.gitbooks.io/docs-react-validation-mixin/content/overview/migration-to-5.html)

---

### Install

Install **mixin** via npm OR yarn:

```javascript
> npm install --save react-validation-mixin
```
```javascript
> yarn add react-validation-mixin
```
Install **validation strategy** via npm OR yarn:

```javascript
> npm install --save joi-validation-strategy
```
```javascript
> yarn add joi-validation-strategy
```
Make sure you install the peer dependency [Joi](https://github.com/hapijs/joi) if using the _joi-validation-strategy_:

```javascript
> npm install --save joi
```
```javascript
> yarn add joi
```
### Strategies

Current list of validation strategy implementations to choose from:

* [joi-validation-strategy](https://github.com/jurassix/joi-validation-strategy) - based on [Joi](https://github.com/hapijs/joi)
* [json-schema-validation-strategy](https://github.com/jefersondaniel/json-schema-validation-strategy) - based on [jsen]
(https://github.com/bugventure/jsen)
* [react-validatorjs-strategy](https://github.com/TheChech/react-validatorjs-strategy) - based on [validatorjs](https://github.com/skaterdav85/validatorjs)

---

### _Please contribute suggestions, features, issues, and pull requests._