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.