Create a very basic new screen to show the thraed's pinned messages (this screen
will be re-used by the message search work on native).
Implementation of the screen will come in the next diff, to make this one easier to
review.
Depends on D7614
Paths
| Differential D7672 Authored by rohan on Apr 27 2023, 11:10 AM.
Details Summary Create a very basic new screen to show the thraed's pinned messages (this screen Implementation of the screen will come in the next diff, to make this one easier to Depends on D7614 Test Plan Navigate to the screen by clicking on the pinned count banner from the previous
Diff Detail
Event TimelineHerald added a subscriber: ashoat. · View Herald TranscriptApr 27 2023, 11:10 AM2023-04-27 11:10:29 (UTC-7) Harbormaster completed remote builds in B18890: Diff 25874.Apr 27 2023, 11:27 AM2023-04-27 11:27:57 (UTC-7) Harbormaster completed remote builds in B19008: Diff 26028.May 2 2023, 5:39 PM2023-05-02 17:39:24 (UTC-7) Comment Actions Looks good, but should @inka be on this diff given that MessagesResult will be used for message search as well? This revision is now accepted and ready to land.May 3 2023, 8:15 AM2023-05-03 08:15:00 (UTC-7) Harbormaster completed remote builds in B19088: Diff 26136.May 5 2023, 4:43 PM2023-05-05 16:43:45 (UTC-7) Harbormaster completed remote builds in B19155: Diff 26226.May 8 2023, 12:30 PM2023-05-08 12:30:13 (UTC-7) Closed by commit rCOMM2e1c72c3d557: [native] Create a new screen to display the thread's pinned messages (authored by RohanK6 <rohan.khanderia@gmail.com>, committed by rohan). · Explain WhyMay 8 2023, 12:38 PM2023-05-08 12:38:09 (UTC-7) This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 26234 native/chat/chat.react.js
native/chat/message-list-container.react.js
native/chat/message-results-screen.react.js
native/navigation/route-names.js
|
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?)