Page MenuHomePhabricator

[native] Replace `listDataSelector` with `useMemo` in `ChatThreadList`
ClosedPublic

Authored by atul on Sep 12 2023, 5:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 16, 7:48 AM
Unknown Object (File)
Fri, Oct 4, 8:25 AM
Unknown Object (File)
Tue, Oct 1, 11:05 PM
Unknown Object (File)
Mon, Sep 30, 5:52 PM
Unknown Object (File)
Sep 16 2024, 12:22 PM
Unknown Object (File)
Sep 11 2024, 6:24 PM
Unknown Object (File)
Sep 11 2024, 6:24 PM
Unknown Object (File)
Sep 11 2024, 6:24 PM
Subscribers
None

Details

Summary

This diff is just one step in the process of converting ChatThreadList into a functional component. When this work is done, we will be able to avoid a lot of re-rendering and hopefully improve performance quite a bit.


Depends on D9173

Test Plan

ChatThreadList + search experience continue to work as expected.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

atul published this revision for review.Sep 12 2023, 5:11 PM
ginsu requested changes to this revision.Sep 13 2023, 9:49 AM

One concern inline

native/chat/chat-thread-list.react.js
587 ↗(On Diff #31019)

Should this be read only?

This revision now requires changes to proceed.Sep 13 2023, 9:49 AM
native/chat/chat-thread-list.react.js
587 ↗(On Diff #31019)

That's how they were typed previously, can try making them $ReadOnly

native/chat/chat-thread-list.react.js
587 ↗(On Diff #31019)

JK, you're totally right.

The chatItems "inside" should be Item[] since we're pushing and unshifting, but both listData and partialListData should be $ReadOnlyArray<Item>

This revision is now accepted and ready to land.Sep 13 2023, 1:13 PM