Page MenuHomePhabricator

[lib] Add React.useMemo around useENSNames result
ClosedPublic

Authored by ashoat on Jan 31 2023, 4:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 15, 10:57 PM
Unknown Object (File)
Mon, May 6, 1:31 PM
Unknown Object (File)
Sun, May 5, 1:29 PM
Unknown Object (File)
Fri, May 3, 8:03 PM
Unknown Object (File)
Thu, May 2, 4:46 PM
Unknown Object (File)
Tue, Apr 30, 1:36 AM
Unknown Object (File)
Sun, Apr 28, 12:13 AM
Unknown Object (File)
Apr 25 2024, 4:57 PM
Subscribers
None

Details

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

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable