From 858c229d5c636cde1100507d4afd76bf003cd0cf Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Sun, 11 Jun 2023 16:43:11 +0800 Subject: [PATCH] fix: fix ref issue. --- src/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.tsx b/src/index.tsx index 22721939..c72cff62 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -52,7 +52,7 @@ export default React.forwardRef((p const [value, setValue] = useState(props.value || ''); useEffect(() => setValue(props.value || ''), [props.value]); const textRef = useRef(null); - useImperativeHandle(ref, () => textRef.current!); + useImperativeHandle(ref, () => textRef.current!, [textRef]); const contentStyle = { paddingTop: padding,