This is the screen that should display the pinned messages / the search results.
Logic is similar to web: https://phab.comm.dev/D7380
Depends on D7672
Differential D7673
[native] Display the pinned messages for the thread in the new screen rohan on Apr 27 2023, 11:15 AM. Authored by Tags None Referenced Files
Details This is the screen that should display the pinned messages / the search results. Logic is similar to web: https://phab.comm.dev/D7380 Depends on D7672 Check to see the pinned messages render in the screen
Diff Detail
Event Timeline
Comment Actions
Is this ready for review at the moment? Sending back to your queue, feel free to re-request review if it is.
Comment Actions It's ready for review now, talked about it in my sync with Ashoat and it'll be best to leave it as is at the moment
Comment Actions Re-requesting review after D7736 and following up about whether we need messageListData or not:
|
You don't need to use React.useMemo(...) here.
The useMemo() hook is helpful for maintaining referential equality so that objects will be considered "shallowly equal" (== in JS) and we can avoid re-renders. This is helpful for objects (including Map(), Set(), etc), arrays (which are objects), and functions (which are objects).
On the other hand, strings in JS are considered shallowly equal if they have the same contents, so we don't have to worry about re-renders if the "content" stays the same.
See below:
(In like C++, which you've been working w/ recently, std::strings can be allocated on the heap (unlike integers, booleans, etc) which may have been part of your reasoning that shallow equality would check reference instead of contents?)