Skip to content

Conversation

@markrickert
Copy link

This PR does a few things to update the code and modernize the component.

This is the best component I've found for swiping rows in a Flatlist (all the other libraries make you style all the hidden elements yourself) so I wanted to stick with this library but it needed a little TLC to make it work with new versions of React since there are lots of deprecated lifecycle methods.

  • I removed all binding functions in favor of property initializers. It's cleaner and there's less chance of memory leaks.
  • I moved the creation of the PanResponder to the constructor method since componentDidMount is deprecated.
  • Switch from the deprecated componentWillReceiveProps to componentDidUpdate
  • Version 1.0.0 would only auto-close the SwipeRow when the property isOpen changed from true->false. I added a contition that allows you to animate the buttons open or closed so that <SwipeRow isOpen={true} /> will animate the row open if it is not.
  • Added a note to stay at 1.0.0 if you're using React Native < 0.54.

I hope you like these changes and integrate them into this really useful and user-friendly library!

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.

1 participant