Skip to content

Commit 858c229

Browse files
committed
fix: fix ref issue.
1 parent 8109771 commit 858c229

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default React.forwardRef<HTMLTextAreaElement, TextareaCodeEditorProps>((p
5252
const [value, setValue] = useState(props.value || '');
5353
useEffect(() => setValue(props.value || ''), [props.value]);
5454
const textRef = useRef<HTMLTextAreaElement>(null);
55-
useImperativeHandle<HTMLTextAreaElement, HTMLTextAreaElement>(ref, () => textRef.current!);
55+
useImperativeHandle<HTMLTextAreaElement, HTMLTextAreaElement>(ref, () => textRef.current!, [textRef]);
5656

5757
const contentStyle = {
5858
paddingTop: padding,

0 commit comments

Comments
 (0)