Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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)