Skip to content
Snippets Groups Projects
Commit 72d00f7e authored by Atte Keinänen's avatar Atte Keinänen
Browse files

Use offsetHeight instead of forcing dom recalculation

parent 83286702
No related branches found
No related tags found
No related merge requests found
......@@ -30,8 +30,7 @@ export default class Header extends Component {
}
componentDidUpdate() {
if (this.refs.header) {
const rect = ReactDOM.findDOMNode(this.refs.header).getBoundingClientRect();
const headerHeight = rect.top + getScrollY();
const headerHeight = ReactDOM.findDOMNode(this.refs.header).offsetHeight + getScrollY();
if (this.state.headerHeight !== headerHeight) {
this.setState({ headerHeight });
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment