For discussing the development and usage of Checkout UI extensions, post-purchase extensions, web pixels, Customer Accounts UI extensions, and POS UI extensions
I am actively developing an Admin Block extension for my app.
My target is const TARGET = 'admin.order-details.block.render'.
My app is installed and configured with these scopes: "write_products,read_orders,write_orders,read_products,write_order_edits"
Using package versions:
While developing today (running `shopify app dev` via CLI) I observed that now when my block extension desctructures the response from the `useApi` hook, the `data` object's `selected` property is an empty array:
// index.tsx import React from 'react' import { useApi, reactExtension } from '@shopify/ui-extensions-react/admin' const TARGET = 'admin.order-details.block.render' export default reactExtension(TARGET, () => <App />) export const App = (): React.ReactElement => { const { data } = useApi(TARGET) // Until today, orderId was defined, but now it is undefined: const orderId = data.selected[0].id console.log(orderId) // -> undefined console.log(data.selected) // -> [] // ... }
This is not the case for the Admin Action extension I am developing - that `data` object's `selected` property still looks correct:
[ { "id": "gid://shopify/Order/123456789" } ]
Was a bug recently introduced? I am aware that this feature is still in developer preview, but if there is a bug, I'd just like to raise the issue. If not, am I doing something incorrectly here? This was working last week and I didn't change anything on my end over the weekend. Thanks in advance.
Hi Miles,
Are you still experiencing this issue?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog