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