Skip to content

SidebarLinks unnecessary re-renders  #21022

@mountiny

Description

@mountiny

Problem:

When we open a report, we end up re-rendering parts of the UI that are not visible, specifically the SidebarLinks. This re-rendering of SidebarLinks is costly and negatively affects performance. Additionally, the re-rendering is unnecessary because it doesn't change anything in the UI. It only occurs because there are changes in the lastRead timestamp and the lastMentionedTime fields of the report that we just opened.

Importance:

When we measure performance, we observe a significant improvement when we optimize SidebarLinks to avoid unnecessary re-rendering (see screenshots).

Solution:

Certain parts of the UI require these specific fields, such as the LHNOptionRow, to be rendered as unread. However, it is not necessary to pass these fields to the entire list. Instead, we can link the OptionRows to the relevant section of the Onyx state to retrieve that information. (We need to measure if this approach of connecting each OptionRow to Onyx introduces any new performance issues.)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015effa438f02c3652
  • Upwork Job ID: 1670728348755038208
  • Last Price Increase: 2023-06-19

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2InternalRequires API changes or must be handled by Expensify staffReviewingHas a PR in review

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions