Bird
Raised Fist0
React Nativemobile~5 mins

Swipeable list items in React Native - Cheat Sheet & Quick Revision

Choose your learning style10 modes available
Recall & Review
beginner
What is a swipeable list item in mobile apps?
A swipeable list item is a list entry that responds to a horizontal swipe gesture, revealing actions like delete or archive, making interaction faster and intuitive.
Click to reveal answer
beginner
Which React Native component helps create swipeable list items?
The Swipeable component from react-native-gesture-handler allows you to add swipe gestures to list items.
Click to reveal answer
intermediate
Why should you use react-native-gesture-handler for swipe gestures instead of basic touch events?
It provides better gesture recognition, smoother animations, and handles gesture conflicts well, improving user experience.
Click to reveal answer
intermediate
How do you add a delete action on swipe left in a swipeable list item?
You define a function that returns a view with a delete button and pass it to the renderRightActions prop of the Swipeable component.
Click to reveal answer
advanced
What accessibility considerations should you keep in mind for swipeable list items?
Ensure swipe actions are also accessible via buttons or other controls, provide clear labels, and support keyboard navigation for users who cannot swipe.
Click to reveal answer
Which prop of the Swipeable component defines the view shown when swiping left?
ArenderRightActions
BrenderLeftActions
ConSwipeRight
DrightSwipeView
What library do you need to install to use the Swipeable component in React Native?
Areact-native-animatable
Breact-native-swipe-list-view
Creact-native-gesture-handler
Dreact-native-swipeable
What is a common use case for swipeable list items?
ATo scroll vertically through a list
BTo reveal quick actions like delete or archive
CTo zoom into images
DTo open a modal window
Which gesture direction usually reveals the delete action in a swipeable list item?
ASwipe left
BSwipe right
CSwipe up
DSwipe down
How can you improve accessibility for swipeable list items?
ADisable swipe gestures
BHide actions from screen readers
CUse only color to indicate actions
DAdd buttons for actions and provide ARIA labels
Explain how to implement a swipeable list item in React Native using react-native-gesture-handler.
Think about how to show buttons when the user swipes.
You got /4 concepts.
    Describe accessibility best practices for swipeable list items in mobile apps.
    Consider users who cannot perform swipe gestures.
    You got /4 concepts.

      Practice

      (1/5)
      1. What is the main purpose of using Swipeable in React Native list items?
      easy
      A. To allow users to swipe list items and reveal hidden actions
      B. To automatically sort list items alphabetically
      C. To add animations when list items are tapped
      D. To disable scrolling on the list

      Solution

      1. Step 1: Understand Swipeable component role

        The Swipeable component enables swipe gestures on list items.
      2. Step 2: Identify the effect of swiping

        Swiping reveals hidden buttons or actions like delete or edit.
      3. Final Answer:

        To allow users to swipe list items and reveal hidden actions -> Option A
      4. Quick Check:

        Swipeable = Reveal actions on swipe [OK]
      Hint: Swipeable shows hidden buttons when you swipe list items [OK]
      Common Mistakes:
      • Thinking Swipeable sorts items automatically
      • Confusing swipe with tap animations
      • Assuming Swipeable disables scrolling
      2. Which prop is used to define the buttons shown when swiping a list item to the right in Swipeable?
      easy
      A. renderLeftActions
      B. renderRightActions
      C. onSwipeRight
      D. swipeButtons

      Solution

      1. Step 1: Recall Swipeable props for swipe actions

        renderLeftActions defines buttons shown when swiping to the right (revealing left side).
      2. Step 2: Match prop to swipe direction

        Swiping to the right reveals buttons from the left side, so renderLeftActions is correct.
      3. Final Answer:

        renderLeftActions -> Option A
      4. Quick Check:

        Right swipe buttons = renderLeftActions [OK]
      Hint: Use renderLeftActions for buttons on right swipe [OK]
      Common Mistakes:
      • Confusing renderRightActions with right swipe
      • Using non-existent prop onSwipeRight
      • Assuming swipeButtons is a valid prop
      3. Given this code snippet, what will happen when the user swipes the list item to the left?
      import { Swipeable } from 'react-native-gesture-handler';
      
      function ListItem() {
        return (
           }
          >
            Message
          
        );
      }
      medium
      A. The 'Archive' button appears when swiping left to right
      B. No button appears on swipe
      C. The 'Archive' button appears when swiping right to left
      D. The list item deletes immediately on swipe

      Solution

      1. Step 1: Understand renderLeftActions behavior

        renderLeftActions shows buttons when swiping to the right (revealing left side).
      2. Step 2: Analyze swipe to the left

        Swiping to the left reveals right side actions via renderRightActions, which is not provided, so no button appears.
      3. Final Answer:

        No button appears on swipe -> Option B
      4. Quick Check:

        Swipe left requires renderRightActions [OK]
      Hint: Swipe left reveals right actions (renderRightActions) [OK]
      Common Mistakes:
      • Thinking renderLeftActions shows on swipe left
      • Confusing the swipe direction for left actions
      • Expecting immediate deletion on swipe
      4. What is wrong with this code snippet that tries to add swipe actions?
      import { Swipeable } from 'react-native-gesture-handler';
      
      function Item() {
        return (
           Delete}
          >
            Item
          
        );
      }
      medium
      A. Swipeable must wrap a View, not Text
      B. renderRightActions should be a boolean, not a function
      C. Missing onSwipe callback prop
      D. Text component cannot be used directly as a swipe action button

      Solution

      1. Step 1: Check renderRightActions return type

        Swipe actions should be interactive buttons or touchable components, not plain Text.
      2. Step 2: Identify correct component usage

        Using Text alone won't respond to touches; use TouchableOpacity or Button.
      3. Final Answer:

        Text component cannot be used directly as a swipe action button -> Option D
      4. Quick Check:

        Swipe actions need touchable components [OK]
      Hint: Swipe actions must be touchable, not plain Text [OK]
      Common Mistakes:
      • Using plain Text instead of touchable components
      • Thinking renderRightActions is a boolean
      • Assuming Swipeable can't wrap Text
      5. You want to create a swipeable list where swiping left reveals a 'Delete' button and swiping right reveals an 'Archive' button. Which code snippet correctly implements this behavior?
      hard
      A. Delete} renderRightActions={() => Archive} > Item
      B. } renderRightActions={() => } > Item
      C. } renderRightActions={() => } > Item
      D. } rightActions={() => } > Item

      Solution

      1. Step 1: Match swipe directions to actions

        Swiping left means moving finger leftwards, revealing right side actions, so 'Delete' should be on right.
      2. Step 2: Assign correct props

        renderRightActions shows buttons on right side (swipe left), renderLeftActions shows buttons on left side (swipe right).
      3. Step 3: Check button components

        Buttons are used correctly, not plain Text.
      4. Final Answer:

        renderLeftActions shows 'Archive', renderRightActions shows 'Delete' -> Option C
      5. Quick Check:

        Left swipe = right actions, right swipe = left actions [OK]
      Hint: Left swipe reveals right actions; right swipe reveals left actions [OK]
      Common Mistakes:
      • Swapping left and right actions
      • Using plain Text instead of buttons
      • Using wrong prop names like leftActions
      Recommended

      Ready to prove it?

      Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

      10 questions~5 mineasy hard