`useProductSearch` returns placeholder items the first time it fires

The first products result from the useProductSearch hook includes only placeholder items, independent from the search query. The real results are triggered shortly after. The loading state turns false when the placeholder items are returned, then briefly true and false again when the real search results are returned. This behaviour is problematic if other hooks are triggered based on the search result, as they will be initially triggered with invalid data.

Minimal reproduction: GitHub - lit-dog/shop-mini-search-repro

Screen recording to demonstrate: https://github.com/user-attachments/assets/2885db90-f35a-499c-9f5e-e3ca5491f7dc

We are experiencing the same issue and it seems like also eating from rate limit

Thanks for reporting, we will take a look!

Thanks for the details and the steps to reproduce @florian-litdog , this really helps us investigate and resolve the issue quickly. We now identified the problem and will be releasing a new version of the SDK to address it.

1 Like

Hi @florian-litdog & @farid , we just released a new version of the SDK to address this issue. You can install the @next tag for the Minis to try this out!

npm install @shopify/shop-minis-react@next --save-exact

Hi @Tunca-Shopify,

Amazing, just tried it out and can confirm it’s fixed in the @next version. Thanks for the rapid fix!

Yes I can also confirm it is fixed. Thank you :folded_hands: