Skip to content

Commit

Permalink
[TextArea]: wrapped component into forwardedRef
Browse files Browse the repository at this point in the history
  • Loading branch information
vik753 committed Apr 3, 2024
1 parent 5685325 commit 7c9c239
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions uui-components/src/inputs/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ interface TextAreaState {
/** Defines boolean state of element focus. */
inFocus?: boolean;
}
// React.Component<TextAreaProps, TextAreaState>
export function TextArea(props: TextAreaProps) {

export const TextArea = React.forwardRef<HTMLDivElement, TextAreaProps>((props, ref) => {
const [state, setState] = useState<TextAreaState>({
inFocus: false,
});
Expand Down Expand Up @@ -122,7 +122,7 @@ export function TextArea(props: TextAreaProps) {
{ ...props.rawProps }
tabIndex={ -1 }
onFocus={ handleWrapperFocus }
ref={ props.forwardedRef }
ref={ ref }
>
<textarea
autoFocus={ props.autoFocus }
Expand Down Expand Up @@ -155,4 +155,4 @@ export function TextArea(props: TextAreaProps) {
/>
</div>
);
}
});

0 comments on commit 7c9c239

Please sign in to comment.