Skip to content

Commit eceb70d

Browse files
committed
Fix last build
1 parent bfae0a2 commit eceb70d

File tree

6 files changed

+13
-95
lines changed

6 files changed

+13
-95
lines changed

example/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dependencies": {
99
"react": "^15.6.1",
1010
"react-dom": "^15.6.1",
11-
"react-validify": "0.0.1",
11+
"react-validify": "0.0.5",
1212
"validatorjs": "^3.13.3"
1313
},
1414
"scripts": {

example/src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { Component } from 'react';
22

33
import Input from './input';
4-
import Form from './form';
4+
import Form from 'react-validify';
55

66
class App extends Component {
77
render() {

example/src/form.js

Lines changed: 0 additions & 85 deletions
This file was deleted.

form.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ export default class Form extends React.Component {
3030
}
3131

3232
onBlur(name) {
33-
console.log('here', name);
33+
let { rules } = this.props;
3434
let { errors, values } = this.state;
3535

36-
const runner = new Validator({ [name]: values[name] }, this.props.rules);
37-
if (runner.fails()) {
36+
const runner = new Validator(
37+
{ [name]: values[name] },
38+
{ [name]: rules[name] }
39+
);
40+
41+
if (runner.fails() && values[name]) {
3842
return this.setState({ errors: { ...errors, ...runner.errors.errors } });
3943
}
40-
4144
if (errors[name])
4245
return this.setState({ errors: { ...errors, [name]: null } });
4346
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-validify",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Form validation made easy",
55
"main": "dist/form.js",
66
"directories": {

0 commit comments

Comments
 (0)