Skip to content

Commit 486c3de

Browse files
feat: allow style overrides for HeaderBackButton (facebook#8626)
1 parent 0d6a43f commit 486c3de

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

packages/stack/src/types.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ export type StackHeaderLeftButtonProps = {
406406
* Accessibility label for the button for screen readers.
407407
*/
408408
accessibilityLabel?: string;
409+
/**
410+
* Style object for the button.
411+
*/
412+
style?: Animated.WithAnimatedValue<StyleProp<ViewStyle>>;
409413
};
410414

411415
export type StackHeaderTitleProps = {

packages/stack/src/views/Header/HeaderBackButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export default function HeaderBackButton({
3030
titleLayout,
3131
truncatedLabel = 'Back',
3232
accessibilityLabel = label && label !== 'Back' ? `${label}, back` : 'Go back',
33+
style,
3334
}: Props) {
3435
const { dark, colors } = useTheme();
3536

@@ -160,7 +161,7 @@ export default function HeaderBackButton({
160161
delayPressIn={0}
161162
onPress={disabled ? undefined : handlePress}
162163
pressColor={pressColorAndroid}
163-
style={[styles.container, disabled && styles.disabled]}
164+
style={[styles.container, disabled && styles.disabled, style]}
164165
hitSlop={Platform.select({
165166
ios: undefined,
166167
default: { top: 16, right: 16, bottom: 16, left: 16 },

0 commit comments

Comments
 (0)