HomePhabricator
Diffusion Comm 101eb34481de

[lib] Fix memoization of useSearchSidebars

Description

[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

Details

Provenance
ashoatAuthored on Sep 26 2023, 11:02 AM
Reviewer
atul
Differential Revision
D9297: [lib] Fix memoization of useSearchSidebars
Parents
rCOMMa8e0ba4637ed: Rename React Native patchfile to reflect upgrade
Branches
Unknown
Tags
Unknown