Page MenuHomePhabricator

[lib] Fix memoization of useSearchSidebars
ClosedPublic

Authored by ashoat on Sep 26 2023, 11:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 15 2024, 3:47 PM
Unknown Object (File)
Apr 12 2024, 3:23 AM
Unknown Object (File)
Apr 10 2024, 12:03 AM
Unknown Object (File)
Apr 9 2024, 2:43 AM
Unknown Object (File)
Apr 9 2024, 2:43 AM
Unknown Object (File)
Apr 8 2024, 5:18 AM
Unknown Object (File)
Apr 3 2024, 5:54 PM
Unknown Object (File)
Mar 13 2024, 5:11 PM
Subscribers

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable