this.app.dispatch is not a function Error In Shopify Embedded App

Can anybody please help. I created an app in shopify via the Shopify cli with remix. On one of the ResourceItem that displays a product, I'm capturing the onClick event and trying to redirect to the admin product page. I used Redirect from @shopify/app-bridge-react to handle the redirection but still get the "this.app.dispatch is not a function" error here's code: import { useAppBridge } from "@shopify/app-bridge-react"; import { Redirect } from "@shopify/app-bridge/actions"; onClick={() => { // Create an App Bridge instance const app = useAppBridge(); // Create a Redirect action const redirect = Redirect.create(app); redirect.dispatch(Redirect.Action.ADMIN_PATH,`/products/${productId}`); }} I also tried adding the config property to AppProvider from app.jsx but still did not work <AppProvider isEmbeddedApp apiKey={apiKey} config={{ apiKey: apiKey, shopOrigin: shopDomain, forceRedirect: true, }} >

Comment (0)

You’ll be in good company