Skip to content

Commit

Permalink
fix: fix ref issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 11, 2023
1 parent 8109771 commit 858c229
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default React.forwardRef<HTMLTextAreaElement, TextareaCodeEditorProps>((p
const [value, setValue] = useState(props.value || '');
useEffect(() => setValue(props.value || ''), [props.value]);
const textRef = useRef<HTMLTextAreaElement>(null);
useImperativeHandle<HTMLTextAreaElement, HTMLTextAreaElement>(ref, () => textRef.current!);
useImperativeHandle<HTMLTextAreaElement, HTMLTextAreaElement>(ref, () => textRef.current!, [textRef]);

const contentStyle = {
paddingTop: padding,
Expand Down

0 comments on commit 858c229

Please sign in to comment.