ctrlplusb / react-sizeme

Make your React Components aware of their width and height!
MIT License
1.95k stars 94 forks source link

Feature Request: clientHeight, offsetHeight and scrollHeight #221

Open amber-cd opened 2 years ago

amber-cd commented 2 years ago

We use this library extensively, and it is extremely useful, but it would be useful to be able to access both the height that a SizeMe-wrapped container takes up (its clientHeight and offsetHeight, depending on the inclusion of the scrollbar and border) and the size that the contents of the container take up (the scrollHeight). I think this can be accessed by the use of two separate SizeMes around a parent container set to represent the clientHeight and a child container styled so that its height matches the scrollHeight but that doesn't seem ideal for performance reasons.