Page MenuHomePhabricator

[lib] Fix memoization of useSearchSidebars
ClosedPublic

Authored by ashoat on Sep 26 2023, 11:04 AM.
Tags
None
Referenced Files
F3317994: D9297.id31423.diff
Tue, Nov 19, 8:05 PM
Unknown Object (File)
Sun, Nov 10, 9:32 PM
Unknown Object (File)
Sun, Oct 27, 10:13 AM
Unknown Object (File)
Oct 14 2024, 4:17 AM
Unknown Object (File)
Oct 14 2024, 4:17 AM
Unknown Object (File)
Oct 14 2024, 4:17 AM
Unknown Object (File)
Oct 14 2024, 4:15 AM
Unknown Object (File)
Sep 1 2024, 7:07 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