mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-22 23:27:54 -05:00
formik-input can set ref to its inner input
This commit is contained in:
parent
e55d2f27d8
commit
b438eed70d
1 changed files with 4 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue