From 4094b46b48824a781dd88a28d609066979bdd3be Mon Sep 17 00:00:00 2001 From: Matteo Mazzarolo Date: Mon, 6 Apr 2020 11:01:28 +0200 Subject: [PATCH] fix: Use the correct width/height on rotation (#403) As per [documentation](https://reactnative.dev/docs/dimensions) the dimentions should be obtained from the `window` item. --- src/Modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Modal.js b/src/Modal.js index 3a675aa..16acf64 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -61,8 +61,8 @@ export class Modal extends Component { } handleDimensionsUpdate = dimensionsUpdate => { - const deviceWidth = dimensionsUpdate.width; - const deviceHeight = dimensionsUpdate.height; + const deviceWidth = dimensionsUpdate.window.width; + const deviceHeight = dimensionsUpdate.window.height; if ( deviceWidth !== this.state.deviceWidth || deviceHeight !== this.state.deviceHeight