From 7c9c239f927463a3edeb282bb5249e71aebe545a Mon Sep 17 00:00:00 2001 From: Ihor Korenets Date: Wed, 3 Apr 2024 20:39:41 +0300 Subject: [PATCH] [TextArea]: wrapped component into forwardedRef --- uui-components/src/inputs/TextArea.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/uui-components/src/inputs/TextArea.tsx b/uui-components/src/inputs/TextArea.tsx index bf1ee3a085..12d38f5a82 100644 --- a/uui-components/src/inputs/TextArea.tsx +++ b/uui-components/src/inputs/TextArea.tsx @@ -37,8 +37,8 @@ interface TextAreaState { /** Defines boolean state of element focus. */ inFocus?: boolean; } -// React.Component -export function TextArea(props: TextAreaProps) { + +export const TextArea = React.forwardRef((props, ref) => { const [state, setState] = useState({ inFocus: false, }); @@ -122,7 +122,7 @@ export function TextArea(props: TextAreaProps) { { ...props.rawProps } tabIndex={ -1 } onFocus={ handleWrapperFocus } - ref={ props.forwardedRef } + ref={ ref } >