Page MenuHomePhabricator

[lib] Add React.useMemo around useENSNames result
ClosedPublic

Authored by ashoat on Jan 31 2023, 4:50 AM.
Tags
None
Referenced Files
F3325249: D6476.diff
Wed, Nov 20, 5:34 AM
Unknown Object (File)
Tue, Oct 29, 3:20 PM
Unknown Object (File)
Sat, Oct 26, 1:29 PM
Unknown Object (File)
Fri, Oct 25, 10:27 PM
Unknown Object (File)
Fri, Oct 25, 12:46 PM
Unknown Object (File)
Oct 13 2024, 12:37 AM
Unknown Object (File)
Oct 10 2024, 7:21 AM
Unknown Object (File)
Oct 10 2024, 7:18 AM
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
No Lint Coverage
Unit
No Test Coverage