Fix null style

This commit is contained in:
Lim Chee Aun 2023-11-19 12:06:39 +08:00
parent eb203a0498
commit 1383296861

View file

@ -1474,8 +1474,10 @@ const Textarea = forwardRef((props, ref) => {
if (!textarea) return;
const resizeObserver = new ResizeObserver(() => {
// Get height of textarea, set height to textExpander
const { height } = textarea.getBoundingClientRect();
textExpanderRef.current.style.height = height + 'px';
if (textExpanderRef.current) {
const { height } = textarea.getBoundingClientRect();
textExpanderRef.current.style.height = height + 'px';
}
});
resizeObserver.observe(textarea);
}, []);