You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please list the package(s) involved in the issue, and include the version you are using
@shopify/ui-extensions version 2024.10.1
@shopify/ui-extensions-react version 2024.10.1
Describe the bug
When using the admin.product-index.action.render target with the useApi hook in TypeScript, the returned object does not include the expected data key that should be present according to the BlockExtensionApi return signature. The returned object only contains navigation, intents, auth, close, storage, extension, i18n, and query properties.
Steps to reproduce the behavior:
Setup:
Create an extension using the admin.product-index.action.render target
Implement the useApi hook in TypeScript
Steps:
Set up the following code:
import{AdminAction,BlockStack,Button,reactExtension,Text,useApi,}from"@shopify/ui-extensions-react/admin";import{useEffect,useState}from"react";constTARGET="admin.product-index.action.render";exportdefaultreactExtension(TARGET,()=><App/>);
functionApp(){consttargetValues=useApi(TARGET);const{ i18n, data, close }=targetValues;console.log("Data",close,data,targetValues);return(<AdminActionprimaryAction={<ButtononPress={()=>{console.log("saving");close();}}>Done</Button>}secondaryAction={<ButtononPress={()=>{console.log("closing");close();}}>Close</Button>}><BlockStack><Text>Alldata: {JSON.stringify(targetValues)},{" "}{JSON.stringify(Object.keys(targetValues))}</Text></BlockStack></AdminAction>
);}
Note that the data property containing product selection data is missing.
Expected behavior
The useApi hook should return an object that includes the data key containing product selection data, as specified in the BlockExtensionApi return signature and consistent with other selection endpoints.
The text was updated successfully, but these errors were encountered:
Please list the package(s) involved in the issue, and include the version you are using
@shopify/ui-extensions version 2024.10.1
@shopify/ui-extensions-react version 2024.10.1
Describe the bug
When using the admin.product-index.action.render target with the useApi hook in TypeScript, the returned object does not include the expected data key that should be present according to the BlockExtensionApi return signature. The returned object only contains navigation, intents, auth, close, storage, extension, i18n, and query properties.
Steps to reproduce the behavior:
Setup:
Create an extension using the admin.product-index.action.render target
Implement the useApi hook in TypeScript
Steps:
Set up the following code:
The main part:
App has proper permissions in shopify.app.toml:
Observe the console output showing only:
Note that the data property containing product selection data is missing.
Expected behavior
The useApi hook should return an object that includes the data key containing product selection data, as specified in the BlockExtensionApi return signature and consistent with other selection endpoints.
The text was updated successfully, but these errors were encountered: