RORK LABJP
MAX — Rork Max generates native Swift for every Apple platform, from iPhone to Vision ProNATIVE — It reaches native capabilities like AR/LiDAR, Metal 3D, Dynamic Island, Live Activities, and HealthKitPUBLISH — Publish to the App Store in two clicks; Rork Max is $200/monthEXPO — Standard Rork builds iOS and Android together via React Native (Expo) and is free to startPROMPT — Describe your app idea in plain English and Rork generates deployable, store-ready codePRICE — Standard Rork's paid plans start at $25/month: build with it first, then consider Max for native featuresMAX — Rork Max generates native Swift for every Apple platform, from iPhone to Vision ProNATIVE — It reaches native capabilities like AR/LiDAR, Metal 3D, Dynamic Island, Live Activities, and HealthKitPUBLISH — Publish to the App Store in two clicks; Rork Max is $200/monthEXPO — Standard Rork builds iOS and Android together via React Native (Expo) and is free to startPROMPT — Describe your app idea in plain English and Rork generates deployable, store-ready codePRICE — Standard Rork's paid plans start at $25/month: build with it first, then consider Max for native features
Articles/Dev Tools
Dev Tools/2026-06-21Advanced

Add Long-Press Drag Reordering to Your Rork Favorites List Without the Jank

A practical walkthrough for retrofitting long-press drag reordering onto a Rork-generated favorites list: keeping re-renders down, respecting the worklet boundary, persisting the order, and avoiding ghost cards and scroll conflicts.

Rork431React Native172Reanimated8drag to reorderstate management4

Premium Article

Letting users rearrange their favorites by hand is one of those features that sounds trivial until you build it. As an indie developer, I run a set of wallpaper apps on both the App Store and Google Play, and the moment I shipped a favorites feature, requests came in to "let me put the ones I use most at the top."

Ask Rork to "make the favorites draggable to reorder," and it usually produces something that looks right but feels wrong on a real device: cards lag behind your finger, or the order snaps back the instant you let go. The generated code tends to be a FlatList with a hand-rolled PanResponder bolted on top, and that is exactly where the trouble starts.

Let's fix it from the failure points inward. The example targets the React Native (Expo) output of Rork, but the same reasoning carries over to Rork Max's SwiftUI output when you add .onMove to a List.

The three walls you hit with drag reordering

Drag-to-reorder looks like "move a card to where the finger is," but three problems show up at once.

The first is dropped frames. If a re-render fires every frame as the finger moves, the JavaScript thread clogs and the card trails behind. To hold 60fps you have to run the drag movement on the UI thread (a worklet), not on the JS thread.

The second is duplicated state. The "visual order" during the drag and the "data order" you persist on release are easy to model as two separate things, and if you reconcile them sloppily, the order rolls back the moment the user lifts their finger.

The third is scroll conflict. In a vertical list, both dragging and scrolling are up-and-down gestures, so unless you decide which wins, scrolling breaks or the drag never starts.

Trying to handle all three with a custom PanResponder balloons the code and breaks across devices. I burned a few hours trying to push a hand-written version through, and my takeaway is that for solo development, leaning on a proven library is the sturdiest choice.

Choosing a library — draggable-flatlist is the pragmatic answer

There are roughly three options for a reorderable list. Here is how they trade off.

OptionStrengthsWatch out for
Custom PanResponderZero dependencies, full controlYou own worklet-ization, scroll conflict, and device quirks
react-native-draggable-flatlistBuilt on Reanimated/Gesture Handler, smooth, short to implementIt is a FlatList inside, so very large data needs extra tuning
FlashList + custom layerFast rendering for huge listsYou still write the drag gesture layer yourself

For a favorites list of tens to a few hundred items, react-native-draggable-flatlist is the shortest and most stable path. It uses react-native-reanimated and react-native-gesture-handler internally and runs the drag movement in a worklet, so you don't have to cross the dropped-frame wall yourself.

When adding it to an Expo-managed Rork project, install Expo-compatible versions.

# Install into an Expo project (use Expo-compatible reanimated/gesture-handler)
npx expo install react-native-reanimated react-native-gesture-handler
npm install react-native-draggable-flatlist

After installing react-native-reanimated, don't forget to put its Babel plugin last in babel.config.js. If it is missing, worklets won't run and the drag simply won't respond.

// babel.config.js — the reanimated plugin MUST be last in the array
module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin'], // ← must be last
  };
};

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
If drag reordering felt broken on your Rork favorites list, you can get a smooth long-press implementation working today
You'll be able to diagnose and fix the three classic failures: stutter while dragging, order snapping back on release, and fights with vertical scroll
You can drop in a minimal persistence pattern that keeps the user's order across app restarts
Secure payment via Stripe · Cancel anytime

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

Related Articles

Dev Tools2026-05-13
Switching from Context API to Zustand v5 in Rork Apps: What Changed and Why It Worked
Context API caused cascading re-renders in a growing Rork app. Here's how migrating to Zustand v5 solved it — with practical patterns for auth state and async logic in React Native.
Dev Tools2026-04-29
Adding Bottom Sheets to a Rork App — A Practical Guide to @gorhom/bottom-sheet on iOS and Android
Rork's default Modal works for confirmations, but the moment you need multiple snap points or inertial scroll inside the sheet it falls short. This guide walks through dropping @gorhom/bottom-sheet into a Rork project, handling the keyboard, and smoothing out iOS/Android differences.
Dev Tools2026-04-24
Reanimated Worklet Errors in Rork Apps — Six Things to Check Before You Panic
React Native Reanimated throws a lot of worklet errors the moment you add it to a Rork project. This walkthrough covers the six most common causes, from a missing Babel plugin to closure capture bugs, in the order you should investigate them.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →