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,