react-textarea-autosize
react-textarea-autosize copied to clipboard
Why IS the performance so poor?
I've moved to using this component instead of the other one, as the other inexplicably stops all transitions from CSSTransitionGroup and the like.
As I've seen reported on here already, when there's a lot of components in use, it's real janky and lags a fair bit - far more than I'd expect from simply doing some calculations involving font sizes and line-heights and whatnot.
I'm not here to complain, but as I've seen a mention of adding an ID increases performance for some reason, are there any other undocumented things we should know about that could smoothen things out a little?
You can use useCacheForDOMMeasurements
prop if your styles are static.
I'd love to work on improving performance if possible, but personally I don't see any junk. Could you record a movie/gif demonstrating the problem? A profiler dump which I could load would also be helpful.
I see same issue also with useCacheForDOMMeasurements.
According to this screenshot componentDidUpdate of react-textarea-autosize fires 11x in a single stack frame. Seems like it's possible that u call setState in onHeightChange callback and you are causing a synchronous rerender - for some reason your component can't "settle" for a while.
Hard to be sure without seeing the repro case though.