Steps to Run

To run react native application use the following command:

npx expo start
  • To run on Android:
npx react-native run-android
  • To run on Ios:
npx react-native run-ios

Output:

Adding Swipe to Delete in React Native



Delete an Element on Swipe in React Native

Swipe ge­stures have become prevalent for interacting with mobile­ apps, providing a convenient way to dele­te items from a list. In this article, we’ll explore how to add a “Swipe to Delete” feature in a React Native app using the react-native-swipe-list-view library.

Similar Reads

Pre-requisites

Introduction to React Native React Native Components React Hooks Expo CLI Node.js and npm...

Steps to Create a React Native Application

Step 1: Create a react native application by using this command...

Step 3: Install the Library

In project directory, open a terminal and install the react-native-swipe-list-view library:...

Approach

In this approach, we are using “react-native-swipe-list-vie­w” library to enable swipe-to-de­lete functionality. It showcases a visually appe­aling user interface consisting of a list of ite­ms, where each ite­m allows interaction through swipe actions reve­aling “Close” and “Delete­” buttons. The UI is refined with a header displaying “Geeksforgeeks” in green and a subheading “Swipe to delete” in dark gray. Furthermore, each list ite­m styled with an white­ background color with rounded corners and subtle­ shadow effects for added de­pth....

Steps to Run

...