|
1 | 1 | # react-native-reanimated-carousel |
2 | 2 |
|
| 3 | +## 5.0.0-beta.1 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- [#853](https://github.com/dohooo/react-native-reanimated-carousel/pull/853) [`c595958`](https://github.com/dohooo/react-native-reanimated-carousel/commit/c59595896381c36cc395f95b8631aee503cfd927) Thanks [@dohooo](https://github.com/dohooo)! - - add `itemWidth`/`itemHeight` props so horizontal and vertical carousels can define their snapping step explicitly (e.g. to show multiple cards per page) |
| 8 | + |
| 9 | + - default behaviour still falls back to the carousel container size or legacy `width`/`height` props |
| 10 | + |
| 11 | +- [#853](https://github.com/dohooo/react-native-reanimated-carousel/pull/853) [`c595958`](https://github.com/dohooo/react-native-reanimated-carousel/commit/c59595896381c36cc395f95b8631aee503cfd927) Thanks [@dohooo](https://github.com/dohooo)! - ## ✨ Style API refresh |
| 12 | + |
| 13 | + - `style` now controls the outer carousel container (positioning, width/height, margins). |
| 14 | + - New `contentContainerStyle` replaces `containerStyle` for styling the scrollable content. |
| 15 | + - `width` and `height` props are deprecated; define size via `style` instead. |
| 16 | + |
| 17 | + ### Migration Example |
| 18 | + |
| 19 | + ```tsx |
| 20 | + // Before |
| 21 | + <Carousel |
| 22 | + width={300} |
| 23 | + height={200} |
| 24 | + containerStyle={{ paddingHorizontal: 16 }} |
| 25 | + /> |
| 26 | + |
| 27 | + // After |
| 28 | + <Carousel |
| 29 | + style={{ width: 300, height: 200 }} |
| 30 | + contentContainerStyle={{ paddingHorizontal: 16 }} |
| 31 | + /> |
| 32 | + ``` |
| 33 | + |
| 34 | + - Any layout logic still works; simply move `width`/`height` into `style` and container tweaks into `contentContainerStyle`. |
| 35 | + - `contentContainerStyle` runs on the JS thread—avoid adding `opacity` / `transform` there if you rely on built-in animations. |
| 36 | + |
| 37 | +### Patch Changes |
| 38 | + |
| 39 | +- [#872](https://github.com/dohooo/react-native-reanimated-carousel/pull/872) [`12c1a63`](https://github.com/dohooo/react-native-reanimated-carousel/commit/12c1a636185e476ba71698f6fe507217c6326d50) Thanks [@dohooo](https://github.com/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. |
| 40 | + |
| 41 | +- [#871](https://github.com/dohooo/react-native-reanimated-carousel/pull/871) [`bc7daaf`](https://github.com/dohooo/react-native-reanimated-carousel/commit/bc7daafbe9c927b54fe0b57c7c137382da7f382f) Thanks [@dohooo](https://github.com/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. |
| 42 | + |
| 43 | +- [#866](https://github.com/dohooo/react-native-reanimated-carousel/pull/866) [`566bf52`](https://github.com/dohooo/react-native-reanimated-carousel/commit/566bf52ef775b861febc74dc602d3f5e7289004c) Thanks [@hennessyevan](https://github.com/hennessyevan)! - Fix pagination accessibility state by syncing selection with scheduleOnRN instead of reading reanimated values during render, and add coverage to avoid test warnings. |
| 44 | + |
3 | 45 | ## 5.0.0-beta.0 |
4 | 46 |
|
5 | 47 | ### Major Changes |
|
16 | 58 | #### Migration Guide |
17 | 59 |
|
18 | 60 | **Before:** |
| 61 | + |
19 | 62 | ```jsx |
20 | 63 | <Carousel |
21 | 64 | width={300} |
22 | 65 | height={200} |
23 | | - style={{ backgroundColor: 'red' }} // Applied to inner container |
| 66 | + style={{ backgroundColor: "red" }} // Applied to inner container |
24 | 67 | containerStyle={{ margin: 10 }} // Applied to outer container |
25 | 68 | /> |
26 | 69 | ``` |
27 | 70 |
|
28 | 71 | **After:** |
| 72 | + |
29 | 73 | ```jsx |
30 | 74 | <Carousel |
31 | | - style={{ |
32 | | - width: 300, |
33 | | - height: 200, |
34 | | - margin: 10 |
| 75 | + style={{ |
| 76 | + width: 300, |
| 77 | + height: 200, |
| 78 | + margin: 10, |
35 | 79 | }} // Applied to outer container |
36 | | - contentContainerStyle={{ backgroundColor: 'red' }} // Applied to inner container |
| 80 | + contentContainerStyle={{ backgroundColor: "red" }} // Applied to inner container |
37 | 81 | /> |
38 | 82 | ``` |
39 | 83 |
|
|
0 commit comments