else if (props.type === 'checkbox') { | |
props.value = option.value; | |
props.checked = formik.values[props.name].includes(option.value); | |
props.onChange = e => { | |
const val = formik.values[props.name]; | |
e.target.checked | |
? val.push(e.target.value) | |
: val.slice(val.indexOf(e.target.value)); | |
formik.setFieldValue(val); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment