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
StickyParallaxHeader
withAvatarHeader
type ->AvatarHeaderScrollView
StickyParallaxHeader
withDetailsHeader
type ->DetailsHeaderScrollView
StickyParallaxHeader
withTabbedHeader
type ->TabbedHeaderPager
StickyParallaxHeader
without specified type ->StickyHeaderScrollView
Differences between old and new api
- new api exports separate components for each of header types, instead of single component with
headerType
prop - new api supports
FlatList
,SectionList
& custom scroll components - new api inherits all props of its scroll component (
ScrollViewProps
,FlatListProps
orSectionListProps
) contentContainerStyles
is removed and can be replaced inTabbedHeaderPager
by passingcontentContainerStyle
topagerProps
horizontalScrollBounces
is removed and can be replaced inTabbedHeaderPager
by passingbounces
topagerProps
header
prop in predefined components is replaced withrenderHeaderBar
headerSize
is replaced withonHeaderLayout
onRef
prop is removedscrollEvent
is replaced with worklet functiononScroll
onMomentumScrollBegin
,onMomentumScrollEnd
,onScrollBeginDrag
&onScrollEndDrag
are worklet functionsscrollRef
is removed, useref
insteadsnapValue
prop is removed
New apis that were not present in version <= 0.4.x
(Avatar|Details|Sticky)HeaderFlatList
-FlatList
version of(Avatar|Details|Sticky)ScrollView
(Avatar|Details|Sticky)HeaderSectionList
-SectionList
version of(Avatar|Details|Sticky)ScrollView
TabbedHeaderList
- tabbed header withSectionList
that 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