Shopify checkout ui component <Link> onPress not working

Shopify checkout ui component <Link> onPress not working

Michael_Chan_
Shopify Partner
2 0 0

https://shopify.dev/docs/api/checkout-ui-extensions/2024-04/components/actions/link
i both set to and onPress , this only navigate to the location specified by to , onPress is not execute as expected.

how can i use ?

 <Link
  to={shop.storefrontUrl}
  onPress={() => {
   conosle.log('onPress')
                  fetch(DATA_URL, {
                    method: "POST",
                    body: JSON.stringify({message: '1'}),
                    headers: {
                      "content-type": "application/json",
                    },
                    keepalive: true,
                  });
                }}
              >
                {translate("Submit and leave")}
              </Link>

Michael_Chan__0-1719565783008.png

 

Replies 0 (0)