Minor Changes
-
#853
c595958Thanks @dohooo! - - additemWidth/itemHeightprops so horizontal and vertical carousels can define their snapping step explicitly (e.g. to show multiple cards per page)- default behaviour still falls back to the carousel container size or legacy
width/heightprops
- default behaviour still falls back to the carousel container size or legacy
-
#853
c595958Thanks @dohooo! - ## ✨ Style API refreshstylenow controls the outer carousel container (positioning, width/height, margins).- New
contentContainerStylereplacescontainerStylefor styling the scrollable content. widthandheightprops are deprecated; define size viastyleinstead.
Migration Example
// Before <Carousel width={300} height={200} containerStyle={{ paddingHorizontal: 16 }} /> // After <Carousel style={{ width: 300, height: 200 }} contentContainerStyle={{ paddingHorizontal: 16 }} />
- Any layout logic still works; simply move
width/heightintostyleand container tweaks intocontentContainerStyle. contentContainerStyleruns on the JS thread—avoid addingopacity/transformthere if you rely on built-in animations.
Patch Changes
-
#872
12c1a63Thanks @dohooo! - Clamp visible ranges for non-loop overdrag and add test to ensure the first item stays visible when dragging right on the first page. Credits to PR #869 reporter. -
#871
bc7daafThanks @dohooo! - Fix non-loop overscroll direction so tiny positive offsets at the first page no longer wrap to the last page when calling next()/scrollTo(), and add integration coverage for the scenario. Thanks to @hennessyevan for the original report and PR 839 inspiration. -
#866
566bf52Thanks @hennessyevan! - Fix pagination accessibility state by syncing selection with scheduleOnRN instead of reading reanimated values during render, and add coverage to avoid test warnings.