Skip to content

Commit

Permalink
refactor: removed render body
Browse files Browse the repository at this point in the history
BREAKING CHANGE:  removed render body property
  • Loading branch information
pi0trpietruszewski committed Sep 17, 2021
1 parent 7cd7022 commit 70107d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 0 additions & 2 deletions src/index.tsx
Expand Up @@ -52,7 +52,6 @@ export interface SharedPredefinedHeaderProps {
snapStopThreshold?: StickyParallaxHeaderProps['snapStopThreshold'];
snapToEdge?: StickyParallaxHeaderProps['snapToEdge'];
snapValue?: StickyParallaxHeaderProps['snapValue'];
transparentHeader?: StickyParallaxHeaderProps['transparentHeader'];
}

export interface IconProps {
Expand All @@ -62,7 +61,6 @@ export interface IconProps {
rightTopIconOnPress?: () => void;
}
export interface RenderBody {
renderBody?: () => ReactNode;
children?: ReactNode;
}

Expand Down
7 changes: 1 addition & 6 deletions src/predefinedComponents/AvatarHeader/AvatarHeader.tsx
Expand Up @@ -222,7 +222,6 @@ class AvatarHeader extends React.Component<AvatarHeaderProps, State> {
backgroundImage,
contentContainerStyles,
children,
renderBody,
headerHeight,
snapToEdge,
bounces,
Expand All @@ -238,10 +237,6 @@ class AvatarHeader extends React.Component<AvatarHeaderProps, State> {
onMomentumScrollBegin,
} = this.props;

if (renderBody) {
console.warn('Warning: renderBody prop is deprecated. Please use children instead');
}

return (
<>
<StatusBar backgroundColor={backgroundColor} barStyle="light-content" />
Expand Down Expand Up @@ -269,7 +264,7 @@ class AvatarHeader extends React.Component<AvatarHeaderProps, State> {
snapToEdge={snapToEdge}
snapValue={snapValue}
transparentHeader={false}>
{renderBody !== undefined ? renderBody() : children}
{children}
</StickyParallaxHeader>
</>
);
Expand Down
10 changes: 2 additions & 8 deletions src/predefinedComponents/DetailsHeader/DetailsHeader.tsx
Expand Up @@ -172,13 +172,11 @@ class DetailsHeader extends React.Component<DetailsHeaderProps, State> {
const {
backgroundColor,
backgroundImage,
renderBody,
children,
headerHeight,
snapToEdge,
bounces,
parallaxHeight,
transparentHeader,
onMomentumScrollEnd,
onMomentumScrollBegin,
scrollRef,
Expand All @@ -187,10 +185,6 @@ class DetailsHeader extends React.Component<DetailsHeaderProps, State> {
refreshControl,
} = this.props;

if (renderBody) {
console.warn('Warning: renderBody prop is deprecated. Please use children instead');
}

return (
<>
<StatusBar barStyle="light-content" backgroundColor={backgroundColor} translucent />
Expand All @@ -213,8 +207,8 @@ class DetailsHeader extends React.Component<DetailsHeaderProps, State> {
refreshControl={refreshControl}
scrollRef={scrollRef}
snapToEdge={snapToEdge}
transparentHeader={transparentHeader}>
{renderBody ? renderBody() : children}
transparentHeader={false}>
{children}
</StickyParallaxHeader>
</>
);
Expand Down

0 comments on commit 70107d0

Please sign in to comment.