Migration from 0.4.x to 1.x.x
How to upgrade?
To upgrade from version <= 0.4.x to 1.x.x first follow installation guide
After installing all packages replace old components with 1.x.x api
StickyParallaxHeaderwithAvatarHeadertype ->AvatarHeaderScrollViewStickyParallaxHeaderwithDetailsHeadertype ->DetailsHeaderScrollViewStickyParallaxHeaderwithTabbedHeadertype ->TabbedHeaderPagerStickyParallaxHeaderwithout specified type ->StickyHeaderScrollView
Differences between old and new api
- new api exports separate components for each of header types, instead of single component with
headerTypeprop - new api supports
FlatList,SectionList& custom scroll components - new api inherits all props of its scroll component (
ScrollViewProps,FlatListPropsorSectionListProps) contentContainerStylesis removed and can be replaced inTabbedHeaderPagerby passingcontentContainerStyletopagerPropshorizontalScrollBouncesis removed and can be replaced inTabbedHeaderPagerby passingbouncestopagerPropsheaderprop in predefined components is replaced withrenderHeaderBarheaderSizeis replaced withonHeaderLayoutonRefprop is removedscrollEventis replaced with worklet functiononScrollonMomentumScrollBegin,onMomentumScrollEnd,onScrollBeginDrag&onScrollEndDragare worklet functionsscrollRefis removed, userefinsteadsnapValueprop is removed
New apis that were not present in version <= 0.4.x
(Avatar|Details|Sticky)HeaderFlatList-FlatListversion of(Avatar|Details|Sticky)ScrollView(Avatar|Details|Sticky)HeaderSectionList-SectionListversion of(Avatar|Details|Sticky)ScrollViewTabbedHeaderList- tabbed header withSectionListthat can be used to create "Uber Eats"-like header layoutuseStickyHeaderProps- base hook that measures header & tab layouts and applies translation to the header layoutuseStickyHeaderScrollProps- hook that sets up props responsible for "snap effect", can be used together withStickyHeader(ScrollView|FlatList|SectionList)to create custom sticky header layoutwithStickyHeader- HOC that creates custom sticky header component from custom scroll componentuseStickyHeaderFlashListScrollProps- hook that sets up props responsible for "snap effect", can be used together with FlashList to create custom sticky header layoutwithStickyHeaderFlashList- HOC that creates custom sticky header component from FlashListwithAvatarHeaderFlashList- HOC that enhances FlashList with avatar header layoutwithDetailsHeaderFlashList- HOC that enhances FlashList with details header layoutwithTabbedHeaderFlashList- HOC that enhances FlashList with tabbed header layout