Hi everyone,
I’m working on a Shopify Hydrogen store using React Router v7 and I’m running into an issue with unwanted revalidation when performing cart actions.
Scenario
On my product page, I fetch data from third-party APIs
Whenever a user adds an item to the cart:
POST /cart
React Router revalidates the product route loader, which causes:
Product route to reload
All useFetcher calls to re-run
My external APIs to be called again unnecessarily
For testing i tryied to disable revalidation completly
export function shouldRevalidate() { return false;}
Is there any way I could prevent 3rd party api refetch here ?
Thanks for any response