const [scrollHeight, setscrollHeight] = React.useState(100)
<textarea
style={{
backgroundColor: 'white',
borderWidth: 0,
width: 900,
height: scrollHeight,
}}
onChange={(e) => {
setoriginal(e.target.value)
dispatch(paragraphObject(e.target.value, translated))
setscrollHeight(e.target.scrollHeight)
}}
value={original ?? ''}
/>
I tried to use onLoad and onLoadedData to setup the scrollHeight but both would not fire....onChange works correctly. All I want is to cancel the scroll by setting the textarea height...any suggestions?