Skip to content

Commit

Permalink
fix: Use the correct width/height on rotation (#403)
Browse files Browse the repository at this point in the history
As per [documentation](https://reactnative.dev/docs/dimensions) the dimentions should be obtained from the `window` item.
  • Loading branch information
mmazzarolo authored Apr 6, 2020
1 parent dde0a2f commit 4094b46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4094b46

Please sign in to comment.