react-native-swipeable
react-native-swipeable copied to clipboard
Animation when removing swipeable item from list.
Hello, everybody!
Using swipeable in conjunction with SectionList.
My implementation is as follows, I make a pile to the left, the button moves out, and when I click, I can remove the item from the list. I want it to be removed with the animation, how do I achieve this? Has anybody done something like that?
I'd love all the help I can get!
Hey @bataevvlad!
You probably need something like: https://reactnative.dev/docs/layoutanimation.
Example:
const handleTrash = (item) => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
// code to trigger remove...
// ...
}
In order this to work on Android you should do this:
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
}
}