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:
- View product details page that has a bundle attached (could run a bit of graphql locally to get this)
- Go back to the product list and select a different product also with a bundle attached
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!