formik-input can set ref to its inner input

This commit is contained in:
Ben Wheeler 2019-08-13 17:42:21 -04:00
parent e55d2f27d8
commit b438eed70d

View file

@ -11,6 +11,7 @@ require('./formik-input.scss');
const FormikInput = ({
className,
error,
setRef,
toolTip,
validationClassName,
wrapperClassName,
@ -30,6 +31,8 @@ const FormikInput = ({
{fail: error},
className
)}
/* formik uses "innerRef" to return the actual input element */
innerRef={setRef}
{...props}
/>
{error ? (
@ -48,10 +51,10 @@ const FormikInput = ({
</div>
);
FormikInput.propTypes = {
className: PropTypes.string,
error: PropTypes.string,
setRef: PropTypes.func,
toolTip: PropTypes.string,
type: PropTypes.string,
validationClassName: PropTypes.string,