Skip to content

items don't render in carousel when loop={false} #855

@calebpanza

Description

@calebpanza

Describe the bug
When setting loop={false} on the Carousel component, carousel items stop rendering entirely. The carousel container is visible (confirmed via background color debugging) but the renderItem function appears to not be called or the rendered content is not displayed.

To Reproduce
Steps to reproduce the behavior:

  1. Create a Carousel with multiple items (4+ items recommended)
  2. Set loop={false} on the Carousel component
  3. Use renderItem to render React components
  4. Run the app
  5. Observe that carousel items do not appear

Code example:

<Carousel
  data={[
    { key: 'step1', component: StepOne },
    { key: 'step2', component: StepTwo },
    { key: 'step3', component: StepThree },
    { key: 'step4', component: StepFour },
  ]}
  renderItem={({ item }) => (
    <View style={{ flex: 1, width: '100%', padding: 32 }}>
      <item.component />
    </View>
  )}
  loop={false}
/>

Expected behavior
The carousel should render items normally when loop={false}, just without looping behavior. Items should be visible and navigable via programmatic scrollTo calls.

Actual behavior

  • Carousel container is visible (can confirm via background colors)
  • No carousel items are rendered/visible
  • Removing loop={false} makes items appear again
  • Setting loop={true} works as expected

Screenshots
N/A - items simply don't render

Versions (please complete the following information):

  • react: v19.1.0
  • react-native: v0.81.4
  • react-native-reanimated: v4.1.1
  • react-native-reanimated-carousel: v5.0.0-beta
  • react-native-gesture-handler: v2.28.0

Smartphone (please complete the following information):

  • Device: iOS Simulator
  • OS: iOS (latest)

Additional context

  • Using Expo SDK 54
  • Carousel is used in a multi-step form context with programmatic navigation via ref.scrollTo()
  • The issue occurs regardless of whether enabled prop is true or false
  • Removing the loop prop entirely (defaulting to loop=true) makes items render correctly

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions