Skip to content

Commit 916e701

Browse files
author
Marek Rozmus
committed
Update if statements - remove specific null checks
1 parent fdc2e61 commit 916e701

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/SwipeableListItem.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class SwipeableListItem extends PureComponent {
170170
if (this.isSwiping()) {
171171
const threshold = this.props.threshold || 0.5;
172172

173-
if (this.listElement !== null) {
173+
if (this.listElement) {
174174
if (this.left < this.listElement.offsetWidth * threshold * -1) {
175175
this.handleSwipedLeft();
176176
} else if (this.left > this.listElement.offsetWidth * threshold) {
@@ -185,7 +185,7 @@ class SwipeableListItem extends PureComponent {
185185

186186
this.resetState();
187187

188-
if (this.listElement != null) {
188+
if (this.listElement) {
189189
this.listElement.className = styles.contentReturn;
190190
this.listElement.style.transform = `translateX(${this.left}px)`;
191191
}
@@ -317,7 +317,7 @@ class SwipeableListItem extends PureComponent {
317317

318318
const opacity = (Math.abs(this.left) / 100).toFixed(2);
319319

320-
if (this.props.onSwipeProgress && this.listElement !== null) {
320+
if (this.props.onSwipeProgress && this.listElement) {
321321
const listElementWidth = this.listElement.offsetWidth;
322322
let swipeDistancePercent = this.previousSwipeDistancePercent;
323323

0 commit comments

Comments
 (0)