react-window-size icon indicating copy to clipboard operation
react-window-size copied to clipboard

Wrong dimensions

Open ferrao opened this issue 7 years ago • 0 comments

On the latest 1.2.2, this component is not looking at the the window dimensions anymore. It is looking at the size of the body element, which can be bigger than the viewport size:

this.state = {
    width: document.body.clientWidth,
    height: document.body.clientHeight,
};

Furthermore, the following line also causes dimensions to be wrong for about 1 whole second:

setTimeout(this._handleResize, 1000);

ferrao avatar Sep 30 '18 14:09 ferrao