From ce5e65af6f785b4c6cef8c3371a54f7148d7214a Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Tue, 18 Aug 2026 10:53:09 +0100 Subject: [PATCH] Fix accelerated checkout button height --- .../src/components/AcceleratedCheckoutButtons.tsx | 3 +-- .../tests/AcceleratedCheckoutButtons.test.tsx | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/components/AcceleratedCheckoutButtons.tsx b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/components/AcceleratedCheckoutButtons.tsx index f3e97a9c9..325f03608 100644 --- a/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/components/AcceleratedCheckoutButtons.tsx +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/src/components/AcceleratedCheckoutButtons.tsx @@ -152,7 +152,6 @@ export type AcceleratedCheckoutButtonsProps = (CartProps | VariantProps) & * /> */ -const defaultStyles = {flex: 1}; const nativeComponentName = 'RCTAcceleratedCheckoutButtons'; const protocolEventTypesConstant = 'checkoutProtocolEventTypes'; const checkoutProtocolEventTypeValues = Object.values(CheckoutProtocol); @@ -287,7 +286,7 @@ export const AcceleratedCheckoutButtons: React.FC< testID="accelerated-checkout-buttons" applePayLabel={applePayLabel} applePayStyle={applePayStyle} - style={{...defaultStyles, height: dynamicHeight}} + style={dynamicHeight ? {height: dynamicHeight} : undefined} checkoutIdentifier={checkoutIdentifier} cornerRadius={cornerRadius} wallets={wallets} diff --git a/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/AcceleratedCheckoutButtons.test.tsx b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/AcceleratedCheckoutButtons.test.tsx index a5738a50a..c9583e36e 100644 --- a/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/AcceleratedCheckoutButtons.test.tsx +++ b/platforms/react-native/modules/@shopify/checkout-kit-react-native/tests/AcceleratedCheckoutButtons.test.tsx @@ -420,10 +420,7 @@ describe('AcceleratedCheckoutButtons', () => { nativeComponent.props.onSizeChange({nativeEvent: {height: 42}}); }); nativeComponent = getByTestId('accelerated-checkout-buttons'); - expect(nativeComponent.props.style).toEqual({ - flex: 1, - height: 42, - }); + expect(nativeComponent.props.style).toEqual({height: 42}); }); it('warns and returns null when missing identifiers in production', () => {