Skip to content

Commit

Permalink
Removes warnings (ISSUE-21)
Browse files Browse the repository at this point in the history
Removes unknown properties from div element before rendering
  • Loading branch information
vramdal authored Aug 23, 2016
1 parent 17ddf00 commit 1d12b97
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions react-swipe-to-reveal-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,15 @@
},

render: function render() {
return React.createElement("div", Object.assign({}, this.props, { onTouchStart: this.touchStart,
onTouchMove: this.touchMove,
onTouchEnd: this.touchEnd }), this.props.children);
var props = Object.assign({}, this.props, { onTouchStart: this.touchStart,
onTouchMove: this.touchMove,
onTouchEnd: this.touchEnd });
var customPropNames = ["onSwiped", "onSwipingUp", "onSwipingRight", "onSwipingLeft", "onSwipedUp", "onSwipedRight", "onSwipedDown", "onSwipedLeft", "flickThreshold", "delta"];
for (var i = 0; i < customPropNames.length; i++) {
var customPropName = customPropNames[i];
delete props[customPropName];
}
return React.createElement("div", props, this.props.children);
}
});

Expand Down

0 comments on commit 1d12b97

Please sign in to comment.