Skip to content

Commit

Permalink
feat(textinput): forward ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Lluis Agusti committed Jul 1, 2019
1 parent fdbe65d commit cce239b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/atoms/InputText/InputText.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { forwardRef } from 'react';
import styled from 'styled-components';
import * as colors from '../../../constants/colors';
import { getBorderColorByStatus } from '../../../helpers/utils';
Expand Down Expand Up @@ -28,8 +28,8 @@ const Input = styled.input<IInput>`
}
`;

const InputText = (props: IInput) => {
return <Input {...props} />;
};
const InputText = forwardRef((props: IInput, ref) => {
return <Input {...props} ref={ref} />;
});

export default InputText;

0 comments on commit cce239b

Please sign in to comment.