Can anyone tell me why I'm getting undefined when I console.log heightSet?
componentDidMount() {
this.updateDimensions();
window.addEventListener('resize', this.updateDimensions.bind(this));
}
componentWillUnmount() {
window.removeEventListener('resize', this.updateDimensions.bind(this));
}
updateDimensions() {
this.setState({ heightSet: document.scrollHeight });
console.log(document.clientHeight);
}
the same console.log worked for window.innerHeight (clientHeight gets undefined as well) but I don't want inner height I want scrollHeight.
thanks