Skip to content

Conversation

dioseltorre
Copy link

When false, the view cannot be swiped. The default value is true.

Summary:
When false, the view cannot be swiped. The default value is true.
@JeffGuKang
Copy link
Collaborator

JeffGuKang commented Oct 27, 2019

Thank you for PR.

How about use this.props.swipeEnabled with defaultProps without componentDidUpdate?

Component.defaultProps = {
  swipeEnabled: true,
}

Summary:
When false, the view cannot be swiped. The default value is true.
Copy link
Collaborator

@JeffGuKang JeffGuKang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. :)
It will be merged after some test.

@viktor992
Copy link

Any updates on this?

@dioseltorre
Copy link
Author

@JeffGuKang When do you plan to merge this?

@JeffGuKang
Copy link
Collaborator

@dioseltorre Sorry for late reply. I will manage this until this week.

@JeffGuKang JeffGuKang self-requested a review December 30, 2019 04:31

_handleShouldSetPanResponder(evt, gestureState) {
return (
this.props.swipeEnabled &&

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than setting a defaultProp value below, you could simply check if swipeEnabled is not false:
this.props.swipeEnabled !== false

}
}

GestureRecognizer.defaultProps = {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And then you can get rid of this....

@Desintegrator
Copy link

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants