I have component like this:
const Panel = () => {
const input = useRef<HTMLTextAreaElement>(null);
return (
<Wrapper>
<Input
ref={input}
/>
<Button
onClick={() => {
input.current?.scrollHeight = "";
}}
>
</Button>
</Wrapper>
);
};
I need to change the Input's scrollHeight on Button click, so I tried to use useRef, but I get an error: Cannot assign to 'scrollHeight' because it is a read-only property. How can I fix it?