Skip to content
This repository has been archived by the owner on Oct 6, 2020. It is now read-only.

Commit

Permalink
fix(Formbot): Built-in required method respects required validation v…
Browse files Browse the repository at this point in the history
…alue
  • Loading branch information
kylealwyn committed Sep 17, 2018
1 parent 0401690 commit 42dac8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Form/Formbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import PropTypes from 'prop-types';

const VALIDATIONS = {
required: val => {
required: (val, isRequired) => {
if (!isRequired) return;
if (!val || (typeof val === 'string' && val === '')) {
throw new Error('This field is required');
}
Expand Down

0 comments on commit 42dac8f

Please sign in to comment.