-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwipeableRow: Remove PropTypes, convert to ES6 class #21386
Conversation
|
||
close(): void { | ||
this.props.onClose(); | ||
this.props.onClose && this.props.onClose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClose is required based on the propTypes, you shouldn't need this check. If you do, then the flow types for onClose aren't properly showing that it is required.
|
||
_handlePanResponderMove(event: PressEvent, gestureState: GestureState): void { | ||
if (this._isSwipingExcessivelyRightFromClosedPosition(gestureState)) { | ||
return; | ||
} | ||
|
||
this.props.onSwipeStart(); | ||
this.props.onSwipeStart && this.props.onSwipeStart(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with onSwipeStart
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could check the other ones in this file too that would be great.
Cleaned up those nullchecks, and removed the nullability of the other props that have default props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TheSavior is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@empyrical merged commit 16f06bc into Once this commit is added to a release, you will see the corresponding version tag below the description at 16f06bc. If the commit has a single |
Summary: Part of: facebook#21342 This PR removes prop types from `SwipeableRow`, and converts it from a `createReactClass` to an ES6 class. Pull Request resolved: facebook#21386 Differential Revision: D10100555 Pulled By: TheSavior fbshipit-source-id: ab350546f4fa6f1ed3fdeae07e342890af6d9a22
Part of: #21342
This PR removes prop types from
SwipeableRow
, and converts it from acreateReactClass
to an ES6 class.Test Plan:
flow check
passes. Nothing seems off in Android RNTester.Release Notes:
Help reviewers and the release process by writing your own release notes. See below for an example.
[GENERAL] [ENHANCEMENT] [Libraries/Experimental/SwipeableRow/SwipeableRow.js] - Removed PropTypes, converted to ES6 class