nkbt / react-height

Component-wrapper to determine and report children elements height
MIT License
180 stars 27 forks source link

It doesn't calculate <h1><h2><h3> tags with margin and padding. #36

Closed singuyen closed 4 years ago

singuyen commented 6 years ago

Hi guys, just noticed it doesn't calculate if the container has h1, h2, h3 tag.

nkbt commented 4 years ago

Yep, because by default it uses element.clientHeight, which does not count any potentially collapsing margins and/or paddings

But you can provide getElementHeight prop and define how exactly you want to get that height