Skip to content

Commit

Permalink
Remove name prop as required.
Browse files Browse the repository at this point in the history
  • Loading branch information
NewOldMax committed Feb 19, 2019
1 parent e816310 commit ef3743c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-form-validator-core",
"version": "0.6.0",
"version": "0.6.1",
"description": "Core validator component for react forms.",
"main": "./lib/index.js",
"scripts": {
Expand Down
5 changes: 2 additions & 3 deletions src/ValidatorForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,14 @@ class ValidatorForm extends React.Component {
}

validate = (input, includeRequired, dryRun) => {
const { value, validators, name } = input.props;
const { value, validators } = input.props;
const result = [];
let valid = true;
let validateResult = false;
const component = this.find(this.childs, component => component.props.name === name);
validators.map((validator) => {
validateResult = this.constructor.getValidator(validator, value, includeRequired);
result.push({ input, result: validateResult });
component.validate(component.props.value, true, dryRun);
input.validate(input.props.value, true, dryRun);
return validator;
});
result.map((item) => {
Expand Down

0 comments on commit ef3743c

Please sign in to comment.