[lib] Fix memoization of useSearchSidebars
Summary:
This addresses ENG-5041. The issue was very similar ENG-4605, which was solved by D8760. Basically we get into an infinite render loop because we get a new array passed in every time, which triggers a new setState on this line, which triggers a new call to useSearchSidebars with a new array...
Adding some memoization here fixed the issue.
Test Plan: I was able to repro the issue in my local environment. After this change, the issue no longer repros
Reviewers: atul, ginsu
Reviewed By: atul
Subscribers: tomek
Differential Revision: https://phab.comm.dev/D9297