HomePhabricator
Diffusion Comm d96eaf524ca8

[lib] Add React.useMemo around useENSNames result

Description

[lib] Add React.useMemo around useENSNames result

Summary: Without this we have a huge performance issue, where the result of useENSNames is recalculated on every render. This can lead to even worse issues if something else depends on the result to set some state, in which case there can be an infinite render loop.

Test Plan: Confirm that infinite render loop goes away – no more log messages about it from React, and I'm able to use the app without it freezing. Note that these effects were only noticeable with the rest of my stack

Reviewers: atul, tomek

Reviewed By: tomek

Differential Revision: https://phab.comm.dev/D6476

Details

Provenance
ashoatAuthored on Jan 31 2023, 4:48 AM
Reviewer
tomek
Differential Revision
D6476: [lib] Add React.useMemo around useENSNames result
Parents
rCOMM0415884fd256: [web] Show ENS names for HistoryRevision
Branches
Unknown
Tags
Unknown