Minor Changes
-
#873
ffb59aaThanks @dohooo! - # Deprecate width/height props in favor of style-based sizingChanges
Deprecated Props
widthandheightprops are now deprecated. Usestyle={{ width: ..., height: ... }}insteaddefaultScrollOffsetValueis deprecated in favor ofscrollOffsetValue
New Behavior
- Carousel now prioritizes dimensions from
styleprop over legacywidth/heightprops - When both
styleand legacy props are provided,styletakes precedence
Migration
Before (v4 style):
<Carousel width={300} height={200} />
After (v5 style):
<Carousel style={{ width: 300, height: 200 }} />
Scroll offset:
// Before <Carousel defaultScrollOffsetValue={sharedValue} /> // After <Carousel scrollOffsetValue={sharedValue} />
Notes
- Legacy props remain functional for backwards compatibility
- Console warnings will guide migration in development mode
- Full removal planned for next major version