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)
Nov 20 2024, 7:38 AM
Unknown Object (File)
Nov 20 2024, 7:35 AM
Unknown Object (File)
Nov 20 2024, 5:34 AM
Unknown Object (File)
Oct 29 2024, 3:20 PM
Unknown Object (File)
Oct 26 2024, 1:29 PM
Unknown Object (File)
Oct 25 2024, 10:27 PM
Unknown Object (File)
Oct 25 2024, 12:46 PM
Unknown Object (File)
Oct 13 2024, 12:37 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