Skip to content

Commit

Permalink
[RNMobile] Correct condition in setting blockWidth (#28635)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukewalczak authored Feb 1, 2021
1 parent aadc511 commit 907a5ae
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,12 @@ class BlockListBlock extends Component {
getBlockWidth( { nativeEvent } ) {
const { layout } = nativeEvent;
const { blockWidth } = this.state;
const layoutWidth = Math.floor( layout.width );

if ( ! blockWidth ) {
if ( ! blockWidth || ! layoutWidth ) {
return;
}

const layoutWidth = Math.floor( layout.width );

if ( blockWidth !== layoutWidth ) {
this.setState( { blockWidth: layoutWidth } );
}
Expand Down

0 comments on commit 907a5ae

Please sign in to comment.