◉RORK LABJP
●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…●GPT-6.1 SOL — Added to Rork's model menu (09-29) with Low, Medium and High effort; included on Pro and Max●SONNET 5.5 — Claude Sonnet 5.5 is selectable: strong at UI design and faster than Sonnet 5 (09-28)●SONNET 4.5 — Retires on the Claude API on 11/30, 27 days left. If your app calls it, check the migration target●SDK 58 — Moves to React Native 0.88. R8 is now on by default in Android release builds, and iOS prebuild generates a SceneDelegate●OBSERVE — EAS Observe now records native crashes too (SDK 57.0.21 or later, 10/07)●NEW — My App Open Ad Only Showed When the App…
Articles/Dev Tools
⬡ Dev Tools/2026-06-20Advanced

Why Your Rork List Starts Duplicating and Dropping Rows as It Grows — Cursor Pagination and Resilient Refetch State

The naive offset pagination Rork scaffolds for you quietly breaks the moment your list changes underneath the user. Here is how to move to a cursor contract, fold every fetch state into one usePaginatedList hook, and recover failed page loads with exponential backoff — implementation first.

Rork611React Native242Expo234paginationinfinite scrollFlatList10state design

✦ Premium Article

A list that felt fine at 50 rows fell apart at 3,000

As an indie developer, a list screen I run in one of my own apps slowly started misbehaving as the data grew. For the first few dozen rows everything was flawless. But once the records crossed a few thousand, the same card would appear twice mid-scroll, a handful of rows would vanish entirely, and the spinner at the bottom would sometimes turn forever.

When I traced it, I landed on the simple pagination Rork had scaffolded for me at the start: offset pagination — "give me n rows starting at position k." It works perfectly in a prototype. But on a list that keeps moving — new posts arriving, old ones removed — that approach fails silently in production.

This article unpacks why that failure happens, then rebuilds the list around a cursor contract and a single state machine for all the fetch states, in real code. Think of it as a set of notes for taking a list the AI got you started on and reworking it into something that holds up over the long run.


Why offset pagination "breaks while it's still working"

Offset pagination slices data by "starting at row k (offset), take n rows (limit)." Page one is offset=0, limit=20; page two is offset=20, limit=20.

The trouble is that the offset points at a rank. In the few seconds a user spends reading page one, suppose a new row is inserted at the top. Everything shifts back by one, and the row that should have led page two is now the same item already shown at the end of page one. That is your duplicate. Delete a row at the top instead and everything shifts forward by one, so a row gets skipped.

AspectOffsetCursor
What it points atA rank (row number)A boundary value (after this id)
List mutates mid-fetchDuplicates and gaps appearBoundary is fixed, so it stays stable
Deep-page performanceSlows down as offset growsStays roughly constant with an index
Jumping to a previous pageEasyNeeds a bidirectional cursor
Fit for infinite scrollLowHigh

For "keep reading forward" use cases like infinite scroll, carrying the boundary itself — "how far have I read?" — makes far more sense than carrying a rank. That is cursor pagination.


✦

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
✦Understand why offset pagination breaks and design a cursor contract that never duplicates or skips rows while the list mutates
✦Fold initial load, load-more, refresh, error, and end-of-list into a single state machine inside a usePaginatedList hook
✦Add exponential-backoff retries for failed page fetches and id-based de-duplication for stable keys — everything a production list needs
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-09-04
EAS secret visibility does not keep a value out of your app — deciding prefix and visibility separately
The EXPO_PUBLIC_ prefix decides what ships inside your app; EAS visibility decides who can read it. Why stacking them blanks a value on OTA updates, and how to check your build.
⬡ Dev Tools2026-08-22
Every bulk replace exited zero. The damage was in the lines I did not delete
Run a bulk replace over generated code and the breakage lands on the neighbouring lines, not the matched ones. Here is what broke in a live project, and a dependency-free guard that checks the invariants a replace must preserve.
⬡ Dev Tools2026-07-30
What Renovate may bump in an Expo app, and what it must never touch
Turning on automated dependency updates in a Rork-generated app also hands Renovate the 123 packages Expo SDK 57 pins. Measured on 2026-07-30, six of them sit a full major version behind npm latest. Here is how to generate the ignore list from the SDK instead of maintaining it by hand.