formik-radio-button can pass custom input ref up

This commit is contained in:
Ben Wheeler 2019-08-13 17:42:58 -04:00
parent b438eed70d
commit 5ec8811427

View file

@ -72,6 +72,7 @@ const FormikRadioButton = ({
label,
name,
onSetCustom,
onSetCustomRef,
value,
...props
}) => (
@ -89,6 +90,7 @@ const FormikRadioButton = ({
<FormikInput
className="formik-radio-input"
name="custom"
setRef={onSetCustomRef}
wrapperClassName="formik-radio-input-wrapper"
/* eslint-disable react/jsx-no-bind */
onChange={event => onSetCustom(event.target.value)}
@ -106,6 +108,7 @@ FormikRadioButton.propTypes = {
label: PropTypes.string,
name: PropTypes.string,
onSetCustom: PropTypes.func,
onSetCustomRef: PropTypes.func,
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string])
};