Skip to content
This repository was archived by the owner on Feb 25, 2020. It is now read-only.

Commit 1695290

Browse files
committed
fix: don't ignore headerLeft if specified. fixes #164
1 parent 28359b3 commit 1695290

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export type SceneDescriptorMap = { [key: string]: SceneDescriptor | undefined };
128128

129129
export type HeaderBackButtonProps = {
130130
disabled?: boolean;
131-
onPress: () => void;
131+
onPress?: () => void;
132132
pressColorAndroid?: string;
133133
backImage?: (props: { tintColor: string }) => React.ReactNode;
134134
tintColor?: string;

src/views/Header/HeaderSegment.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ export default class HeaderSegment extends React.Component<Props, State> {
141141
leftLabel: previousTitle,
142142
onGoBack,
143143
headerTitle,
144-
headerLeft: left = (props: HeaderBackButtonProps) => (
145-
<HeaderBackButton {...props} />
146-
),
144+
headerLeft: left = onGoBack
145+
? (props: HeaderBackButtonProps) => <HeaderBackButton {...props} />
146+
: undefined,
147147
// @ts-ignore
148148
headerStatusBarHeight = getStatusBarHeight(layout.width > layout.height),
149149
headerTransparent,
@@ -295,7 +295,7 @@ export default class HeaderSegment extends React.Component<Props, State> {
295295
style={{ height: headerStatusBarHeight }}
296296
/>
297297
<View pointerEvents="box-none" style={styles.content}>
298-
{onGoBack ? (
298+
{left ? (
299299
<Animated.View
300300
pointerEvents="box-none"
301301
style={[styles.left, leftButtonStyle, leftContainerStyle]}

0 commit comments

Comments
 (0)