What is wrong with this
import React, { useState, useEffect } from “react”;
import {
Button,
reactExtension,
useApi,
} from “@shopify/ui-extensions-react/customer-account”;
export default reactExtension(
“customer-account.order.action.menu-item.render”,
() => ,
);
function MenuActionItemExtension() {
const { orderId } = useApi();
const [canCancel, setCanCancel] = useState(true);
< 999 to=“extension:cancel-page-ui/”>Cancel</999> //999==Button
}
[[extensions.targeting]]
module = “./src/CancelButton.jsx”
target = “customer-account.order.action.menu-item.render”
[extensions.capabilities]
Gives your extension access to directly query Shopify’s storefront API.
Configuration
api_access = true
[[extensions]]
type = “ui_extension”
name = “My wishlist”
handle = “cancel-page-ui”
[[extensions.targeting]]
module = “./src/CancelPage.jsx”
target = “customer-account.order.page.render”
when i press cancel it goes to https://shopify.com/9281912/account/pages/ac03cb2f-a033-4d1a-bfcb-96256ac05c9e
but it should go to
https://shopify.com/9281912/account/orders/6179429712162/pages/ac03cb2f-a033-4d1a-bfcb-96256ac05c9e
to work .
am i missing something . i just want to create a cancel page for customer to cancel order