I try to make an input component where the text is wrapping and height of the input increases at each new line appear. I mean something like on desktop facebook. When you click on someone, open the message box and write something in the input, the input becomes larger every new text line.
I am using textarea for it:
<Input />
const Input = styled.textarea`
border: 0;
outline: none;
padding: 5px 10px;
border-radius: 20px;
font-size: 14px;
width: 100%;
overflow-wrap: break-word;
height: 24px;
`;
And after entering 5 lines of text, the scroll bar should appear. How can I do this?