Product Configuration Admin UI Extension is not updating for different products

Hey all,

I’ve been building something on top of the Product Configuration Admin UI Extension (that is these two targets: admin.product-details.configuration.render and admin.product-variant-details.configuration.render). I’m able to get it to render and to grab context for the current product through the useApi hook without any trouble. When switching to a different product though, it seems to reuse the previous render for the previous product. On refreshing the page, it does update the block.

Here’s a minimal implementation that reproduces the issue:

const TARGET = 'admin.product-details.configuration.render';
export default reactExtension(TARGET, () => <App/>);

function App() {
  const {data} = useApi(TARGET);
  return <Text>Rendering for product ID: {data.product.id}</Text>
}

To reproduce:

The only workaround I’ve found so far is to force refresh the page every time you view a product details page. I’ve tried to dig into how the Shopify-built Bundles app resolves this and noticed that the block is using Polaris components that are banned in extensions so maybe they’ve done something hard-coded into Admin instead of using extensions?

Thanks for any help!

Hey, did you ever find a solution for this? I have the exact same issue.

Hi, I’m also experiencing this bug. I’ve deployed to my test app and my admin Product Configuration extension works on the first product, but any subsequent product visited by hitting the back arrow and selecting a new bundle product loads the extension with first products data again.

Like you said, refreshing the product page reloads the extension to use the correct product data.

HI. Any luck? IS it true that Polaris components are banned in extensions? The admin ui components are awfully primitive!

I’m also seeing this issue. It seems to go away if you “pin” the block. But if you just load it and look at it in “preview” mode it doesn’t get the new product ID when you navigate.

Has anyone found a workaround or experienced the same thing?