-
-
Notifications
You must be signed in to change notification settings - Fork 351
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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:
- Create a Carousel with multiple items (4+ items recommended)
- Set
loop={false}on the Carousel component - Use
renderItemto render React components - Run the app
- 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
enabledprop is true or false - Removing the
loopprop entirely (defaulting to loop=true) makes items render correctly
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working