came up with simple solution for React Angular or Vue.
You just need to wrap the textarea in a div, write the content of textarea in the div and give the textarea absolute position, height and width 100% (don't forget relative position on the div).
So now the div and the textarea are perfectly superimposed, and when the div is expanding because of the text inside, textarea will automatically do so.
Don't forget to set exact same padding, font-size and font-family.