◉RORK LABJP
●RESET — Since 11/23, Reset in the iPhone preview opens your app like a fresh install●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 6 days left. Check which model your AI features call●AUTH TAB — Expo users report Android apps being killed while the sign-in tab is open●NEW — New: Archive or delete? Where to draw the line when tidying projects●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 7 days left●COCOAPODS — With CocoaPods Trunk going read-only, developers are weighing a move to SwiftPM for Expo apps●RESET — Since 11/23, Reset in the iPhone preview opens your app like a fresh install●SONNET 4.5 — Sonnet 4.5 retires from the Claude API on 11/30, 6 days left. Check which model your AI features call●AUTH TAB — Expo users report Android apps being killed while the sign-in tab is open●NEW — New: Archive or delete? Where to draw the line when tidying projects●2.5 ROUTE — From 12/1, Gemini 2.5 requests reroute to newer models at new rates. 7 days left●COCOAPODS — With CocoaPods Trunk going read-only, developers are weighing a move to SwiftPM for Expo apps
Articles/App Dev
◇ App Dev/2026-11-24Intermediate

Why Only the First Page of Your Carousel Is Blank at Launch, and How to Make FlatList Start on the Right Page

My wallpaper app opened on an empty first page. Swiping showed page two just fine, and swiping back left page one empty again. The pager had been told where to start before it knew its own size. Here is the Android fix and the Expo FlatList pattern that closes the same gap.

Expo238React Native244FlatList11CarouselInitial render

✦ Premium Article

I was trying out an update of my wallpaper app on a test phone when the main screen came up as one flat color. No wallpaper, no spinner. I swiped left and page two appeared instantly. I swiped back, and page one was still empty.

As an indie developer, my first instinct was the network. A slow connection, a corrupted cache, a bad URL. But once I traced it, the first page had not failed to load an image. The page itself had never been built. Everything went wrong before the image library was even involved.

The real cause was timing. I was telling the pager which page to start on before it had measured itself, so the binding for that first page was simply skipped. What follows is the Android fix I actually shipped, and the way the same gap shows up, and closes, in the Expo code that Rork tends to generate.

What was actually happening

Three symptoms lined up:

  • Only the page meant to appear first was empty at launch
  • Swiping drew page two and beyond normally
  • Swiping forward and back again did not bring page one back

That last one was the giveaway. If swiping proves the image path works, but page one still never returns, the problem sits upstream of image loading. It sits where the pager decides which pages to build.

On Android, I was passing the start position to ViewPager2 synchronously, right after creating the screen. The adapter had not finished measuring itself. The pager accepted the jump, but the bind for the page it jumped to fell through the cracks. Every later page got bound fresh on swipe, which is why everything else looked fine.

The Android fix I shipped

The change itself was almost embarrassingly small. I moved the position call to after layout.

// Before: position set synchronously right after the screen is created.
// The adapter has not been measured yet, so the initial page bind is skipped.
viewPager.setAdapter(adapter);
viewPager.setCurrentItem(adapter.getStartPosition(), false);
 
// After: queue it with post so it runs once measure/layout has completed.
viewPager.setAdapter(adapter);
viewPager.post(() ->
    viewPager.setCurrentItem(adapter.getStartPosition(), false)
);

Anything handed to post goes onto that view's message queue and runs after a full measure and layout pass. Swapping the order was enough for the first page to be built properly.

What made me pause was the thought that the same ordering mistake could live elsewhere. I added an item to my iOS checklist: look for any place that hands UIPageViewController its first page inside viewDidLoad. I have not seen the symptom on iOS. It is a preventive check, based on the fact that the same screen structure invites the same ordering mistake.

A pager gets its position only after it knows its size. That is the one ordering rule I now settle before writing any carousel, on any platform.

✦

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
✦When the first page of a pager stays blank at launch, you will know to suspect when the position was handed over, not the image loading, and save yourself the wrong investigation
✦You can rebuild a horizontal FlatList so that initialScrollIndex arrives only after the width is known, and have it open on the intended page on any device or split-screen layout
✦You will be able to drop in a small dev-only watcher that tells you within seconds whether a layout change has quietly brought the blank page back
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

◇ App Dev2026-10-15
When adjustsFontSizeToFit Shrinks Just One Row, Suspect the Box Height, Not the String
Only the 10th row of a list drops to 4pt on iOS, though the data and strings are fine. I read the Yoga rounding and font-fit sources, then counted how often the box comes up short in Node.
◇ App Dev2026-08-25
iOS 27 Is Out: The Order I Check My Live Rork App on a Spare iPhone
With iOS 27 and 27.2 on most phones, here is how I check a live Rork app on a spare iPhone: a check order by breakage risk, a symptom-to-cause table, what EAS Update can fix versus what needs a rebuild, and when to move to SDK 58.
◇ App Dev2026-08-16
My chart broke on day one, not at scale
A line chart that vanished for anyone with only a few days of data. The cause was a zero-height Y axis turning coordinates into NaN. Here is the measured behavior and the small normalization layer that fixed it.