From 28651e9b65c0ac2812612daa94ca7eef04ef1bcc Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Mon, 2 Oct 2023 08:27:52 +0200 Subject: [PATCH] Add small comment about REPORT_METADATA onyx key --- src/ONYXKEYS.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index a1afc4fef2c1..0a17d3a1d2f7 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -238,6 +238,9 @@ const ONYXKEYS = { POLICY_RECENTLY_USED_TAGS: 'policyRecentlyUsedTags_', WORKSPACE_INVITE_MEMBERS_DRAFT: 'workspaceInviteMembersDraft_', REPORT: 'report_', + // REPORT_METADATA is a perf optimization used to hold loading states (isLoadingReportActions, isLoadingMoreReportActions). + // A lot of components are connected to the Report entity and do not care about the actions. Setting the loading state + // directly on the report caused a lot of unnecessary re-renders REPORT_METADATA: 'reportMetadata_', REPORT_ACTIONS: 'reportActions_', REPORT_ACTIONS_DRAFTS: 'reportActionsDrafts_',