diff --git a/src/Form/Formbot.js b/src/Form/Formbot.js index d12070c..3342880 100644 --- a/src/Form/Formbot.js +++ b/src/Form/Formbot.js @@ -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'); }