Multiple requests hit on component unmounts / route change in react
iamdhrooov opened this issue ยท 5 comments
๐ Bug description
When changing routes in react or unmounting the components, the library hits the queries multiple times. (number of times specific refinements are added). This is happening on latest version v6.30.3 and not happening for v6.29.0
๐ Bug reproduction
Steps to reproduce the behavior:
- Go to Codepen link
- Click on
Change route on top
- Check API query calls in the network tab.
- Multiple queries hit on unmount.
- Change version to v6.29.0 -> works fine
Live reproduction:
https://codesandbox.io/s/strange-flower-13wnc5?file=/App.tsx
๐ญ Expected behavior
It should not hit queries multiple times.
Environment
- React InstantSearch Hooks version: [6.30.3]
Hello @iamdhrooov,
Thanks for reporting this issue, I'm working on PR #3590 to fix it.
It should be released this week.
Thanks for your patience!
Hey @iamdhrooov! This issue should be fixed in the latest release of React InstantSearch Hooks v6.31.1.
Feel free to reopen if that's not the case, thank you!
Thanks for the quick turnaround on this @FabienMotte Really appreciate it. :)
Would these excess network requests result in additional charges?
Yes, every request which happens will be charged. If this had an impact on your pricing fixed since 6.31.1, you can contact support@algolia.com