From 51758396fad2ad40079ced96ceadf677f8103fd2 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Tue, 16 Sep 2025 13:22:32 +0200 Subject: [PATCH 1/7] Add eslint rule to prevent adding new backTo params to screen type definitions --- .eslintrc.js | 13 ++ src/libs/Navigation/types.ts | 263 ++++++++++++++++++++++++++++++++++- 2 files changed, 274 insertions(+), 2 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 792bb6e89ada..f8dbe866d554 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -351,6 +351,19 @@ module.exports = { }, overrides: [ + // Prevent adding new `backTo` params to screen type definitions + { + files: ['src/libs/Navigation/types.ts'], + rules: { + 'no-restricted-syntax': [ + 'error', + { + selector: 'TSPropertySignature[key.name="backTo"]', + message: 'The `backTo` route param is deprecated. Do not add new `backTo` properties to screen param lists. See contributingGuides/NAVIGATION.md.', + }, + ], + }, + }, // Enforces every Onyx type and its properties to have a comment explaining its purpose. { files: ['src/types/onyx/**/*.ts'], diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 2d9b9009c410..6c547f60e9df 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -71,11 +71,13 @@ type SplitNavigatorParamList = { type SplitNavigatorBySidebar = (typeof SIDEBAR_TO_SPLIT)[T]; type BackToParams = { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; type ConsoleNavigatorParamList = { [SCREENS.PUBLIC_CONSOLE_DEBUG]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; }; @@ -92,22 +94,27 @@ type SettingsNavigatorParamList = { country?: Country | ''; }; [SCREENS.SETTINGS.PROFILE.ADDRESS_COUNTRY]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; country: string; }; [SCREENS.SETTINGS.PROFILE.CONTACT_METHODS]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_DETAILS]: { contactMethod: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; shouldSkipInitialValidation?: string; }; [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: Routes; }; [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_VERIFY_ACCOUNT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: Routes; }; @@ -121,10 +128,12 @@ type SettingsNavigatorParamList = { }; [SCREENS.SETTINGS.MERGE_ACCOUNTS.ACCOUNT_VALIDATE]: { login: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: Routes; }; [SCREENS.SETTINGS.MERGE_ACCOUNTS.MERGE_RESULT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; result: ValueOf; login: string; @@ -133,11 +142,13 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.LOCK.UNLOCK_ACCOUNT]: undefined; [SCREENS.SETTINGS.LOCK.FAILED_TO_LOCK_ACCOUNT]: undefined; [SCREENS.SETTINGS.CONSOLE]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.SETTINGS.SHARE_LOG]: { /** URL of the generated file to share logs in a report */ source: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.SETTINGS.WALLET.CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS]: undefined; @@ -152,6 +163,7 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD]: { /** cardID of selected card */ cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS.WALLET.REPORT_VIRTUAL_CARD_FRAUD_CONFIRMATION]: { @@ -185,6 +197,7 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.ADDRESS]: { policyID: string; country?: Country | ''; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.NAME]: undefined; @@ -192,6 +205,7 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.SHARE]: undefined; [SCREENS.WORKSPACE.INVITE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.MEMBERS_IMPORT]: { @@ -205,48 +219,58 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.INVITE_MESSAGE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.INVITE_MESSAGE_ROLE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORY_CREATE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_CREATE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORY_EDIT]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_EDIT]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORY_PAYROLL_CODE]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_PAYROLL_CODE]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORY_GL_CODE]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_GL_CODE]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORY_DEFAULT_TAX_RATE]: { @@ -272,21 +296,25 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.CATEGORY_SETTINGS]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORY_SETTINGS]: { policyID: string; categoryName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.UPGRADE]: { policyID?: string; featureName?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; categoryId?: string; }; [SCREENS.WORKSPACE.DOWNGRADE]: { policyID?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.PAY_AND_DOWNGRADE]: { @@ -294,34 +322,42 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.CATEGORIES_SETTINGS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_SETTINGS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORIES_IMPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_IMPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CATEGORIES_IMPORTED]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_IMPORTED]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAG_CREATE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAG_CREATE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.DISTANCE_RATE_DETAILS]: { @@ -346,41 +382,54 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.TAGS_SETTINGS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_SETTINGS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAGS_IMPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAGS_IMPORT_OPTIONS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAGS_IMPORT_MULTI_LEVEL_SETTINGS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAGS_IMPORTED]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md + backTo?: Routes; + }; + [SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORTED]: { + policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; - [SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_IMPORTED]: {policyID: string; backTo?: Routes}; [SCREENS.WORKSPACE.TAGS_IMPORTED_MULTI_LEVEL]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAG_SETTINGS]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; parentTagsFilter?: string; }; @@ -388,63 +437,74 @@ type SettingsNavigatorParamList = { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; parentTagsFilter?: string; }; [SCREENS.WORKSPACE.TAG_LIST_VIEW]: { policyID: string; orderWeight: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAG_LIST_VIEW]: { policyID: string; orderWeight: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAGS_EDIT]: { policyID: string; orderWeight: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_EDIT]: { policyID: string; orderWeight: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAG_EDIT]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAG_EDIT]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAG_APPROVER]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAG_APPROVER]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAG_GL_CODE]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAG_GL_CODE]: { policyID: string; orderWeight: number; tagName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS.SUBSCRIPTION.SIZE]: { @@ -510,17 +570,20 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.OWNER_CHANGE_SUCCESS]: { policyID: string; accountID: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.OWNER_CHANGE_ERROR]: { policyID: string; accountID: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.OWNER_CHANGE_CHECK]: { policyID: string; accountID: number; error: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.CREATE_DISTANCE_RATE]: { @@ -551,26 +614,32 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_DATE_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_INVOICE_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_OUT_OF_POCKET_EXPENSES_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_NON_REIMBURSABLE_DEFAULT_VENDOR_SELECT]: { @@ -578,26 +647,32 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_COMPANY_CARD_EXPENSE_ACCOUNT_COMPANY_CARD_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_ONLINE_EXPORT_PREFERRED_EXPORTER]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_COMPANY_CARD_EXPENSE_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_COMPANY_CARD_EXPENSE_ACCOUNT_COMPANY_CARD_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_NON_REIMBURSABLE_DEFAULT_VENDOR_SELECT]: { @@ -605,34 +680,42 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_COMPANY_CARD_EXPENSE_ACCOUNT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_ADVANCED]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_DATE_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_PREFERRED_EXPORTER]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT_OUT_OF_POCKET_EXPENSES_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_EXPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.QUICKBOOKS_DESKTOP_SETUP_MODAL]: { @@ -688,10 +771,12 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_EXPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_EXPORT_PURCHASE_BILL_DATE_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_ADVANCED]: { @@ -699,10 +784,12 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_BILL_STATUS_SELECTOR]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_EXPORT_BANK_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_INVOICE_ACCOUNT_SELECTOR]: { @@ -710,6 +797,7 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_EXPORT_PREFERRED_EXPORTER_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.XERO_BILL_PAYMENT_ACCOUNT_SELECTOR]: { @@ -717,6 +805,7 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_PREREQUISITES]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.ENTER_SAGE_INTACCT_CREDENTIALS]: { @@ -773,47 +862,57 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_EXPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_PREFERRED_EXPORTER_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_DATE_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_EXPORT_EXPENSES]: { policyID: string; expenseType: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_EXPORT_EXPENSES_DESTINATION_SELECT]: { policyID: string; expenseType: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_EXPORT_EXPENSES_VENDOR_SELECT]: { policyID: string; expenseType: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_EXPORT_EXPENSES_PAYABLE_ACCOUNT_SELECT]: { policyID: string; expenseType: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_EXPORT_EXPENSES_JOURNAL_POSTING_PREFERENCE_SELECT]: { policyID: string; expenseType: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_RECEIVABLE_ACCOUNT_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_INVOICE_ITEM_PREFERENCE_SELECT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.NETSUITE_INVOICE_ITEM_SELECT]: { @@ -876,39 +975,48 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_EXPORT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_PREFERRED_EXPORTER]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_EXPORT_DATE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_REIMBURSABLE_EXPENSES]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_NON_REIMBURSABLE_EXPENSES]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_REIMBURSABLE_DESTINATION]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_NON_REIMBURSABLE_DESTINATION]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_DEFAULT_VENDOR]: { policyID: string; reimbursable: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_NON_REIMBURSABLE_CREDIT_CARD_ACCOUNT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.ACCOUNTING.SAGE_INTACCT_ADVANCED]: { @@ -932,6 +1040,7 @@ type SettingsNavigatorParamList = { [SCREENS.SETTINGS.DELEGATE.DELEGATE_ROLE]: { login: string; role?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS.DELEGATE.UPDATE_DELEGATE_ROLE]: { @@ -956,14 +1065,17 @@ type SettingsNavigatorParamList = { cardID: string; }; [SCREENS.KEYBOARD_SHORTCUTS]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.SETTINGS.EXIT_SURVEY.REASON]: undefined; [SCREENS.SETTINGS.EXIT_SURVEY.RESPONSE]: { [EXIT_SURVEY_REASON_FORM_INPUT_IDS.REASON]: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.SETTINGS.EXIT_SURVEY.CONFIRM]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.WORKSPACE.TAX_CREATE]: { @@ -1000,12 +1112,14 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.COMPANY_CARDS_BANK_CONNECTION]: { policyID: string; bankName: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.WORKSPACE.COMPANY_CARD_DETAILS]: { policyID: string; bank: CompanyCardFeed; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.COMPANY_CARD_NAME]: { @@ -1017,10 +1131,12 @@ type SettingsNavigatorParamList = { policyID: string; cardID: string; bank: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_ISSUE_NEW]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_BANK_ACCOUNT]: { @@ -1031,6 +1147,7 @@ type SettingsNavigatorParamList = { }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_SETTINGS_ACCOUNT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_SETTINGS_FREQUENCY]: { @@ -1042,6 +1159,7 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.COMPANY_CARDS_ASSIGN_CARD]: { policyID: string; feed: CompanyCardFeed; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.COMPANY_CARDS_SETTINGS_FEED_NAME]: { @@ -1053,41 +1171,49 @@ type SettingsNavigatorParamList = { [SCREENS.WORKSPACE.EXPENSIFY_CARD_DETAILS]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_NAME]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_LIMIT]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD_LIMIT_TYPE]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.EXPENSIFY_CARD.EXPENSIFY_CARD_DETAILS]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.EXPENSIFY_CARD.EXPENSIFY_CARD_NAME]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.EXPENSIFY_CARD.EXPENSIFY_CARD_LIMIT]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.EXPENSIFY_CARD.EXPENSIFY_CARD_LIMIT_TYPE]: { policyID: string; cardID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.REPORTS_DEFAULT_TITLE]: { @@ -1161,6 +1287,7 @@ type SettingsNavigatorParamList = { type TwoFactorAuthNavigatorParamList = { [SCREENS.TWO_FACTOR_AUTH.ROOT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: string; }; @@ -1169,10 +1296,12 @@ type TwoFactorAuthNavigatorParamList = { forwardTo?: Routes; }; [SCREENS.TWO_FACTOR_AUTH.VERIFY]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: string; }; [SCREENS.TWO_FACTOR_AUTH.SUCCESS]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: string; }; @@ -1198,6 +1327,7 @@ type ProfileNavigatorParamList = { accountID: string; reportID: string; login?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; }; @@ -1212,16 +1342,19 @@ type NewReportWorkspaceSelectionNavigatorParamList = { type ReportDetailsNavigatorParamList = { [SCREENS.REPORT_DETAILS.ROOT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_DETAILS.SHARE_CODE]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_DETAILS.EXPORT]: { reportID: string; policyID: string; connectionName: ConnectionName; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1229,6 +1362,7 @@ type ReportDetailsNavigatorParamList = { type ReportChangeWorkspaceNavigatorParamList = { [SCREENS.REPORT_CHANGE_WORKSPACE.ROOT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1236,22 +1370,27 @@ type ReportChangeWorkspaceNavigatorParamList = { type ReportSettingsNavigatorParamList = { [SCREENS.REPORT_SETTINGS.ROOT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_SETTINGS.NAME]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_SETTINGS.NOTIFICATION_PREFERENCES]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_SETTINGS.WRITE_CAPABILITY]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_SETTINGS.VISIBILITY]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1259,6 +1398,7 @@ type ReportSettingsNavigatorParamList = { type ReportDescriptionNavigatorParamList = { [SCREENS.REPORT_DESCRIPTION_ROOT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1266,20 +1406,24 @@ type ReportDescriptionNavigatorParamList = { type ParticipantsNavigatorParamList = { [SCREENS.REPORT_PARTICIPANTS.ROOT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_PARTICIPANTS.INVITE]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_PARTICIPANTS.DETAILS]: { reportID: string; accountID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.REPORT_PARTICIPANTS.ROLE]: { reportID: string; accountID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1287,16 +1431,19 @@ type ParticipantsNavigatorParamList = { type RoomMembersNavigatorParamList = { [SCREENS.ROOM_MEMBERS.ROOT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.ROOM_MEMBERS.INVITE]: { reportID: string; role?: 'accountant'; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.ROOM_MEMBERS.DETAILS]: { reportID: string; accountID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1306,12 +1453,14 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.EDIT_REPORT]: { action: IOUAction; iouType: IOUType; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; shouldTurnOffSelectionMode?: boolean; }; @@ -1320,6 +1469,7 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; reportActionID?: string; }; @@ -1327,6 +1477,7 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_PARTICIPANTS]: { @@ -1334,6 +1485,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_DATE]: { @@ -1341,6 +1493,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; reportActionID?: string; }; @@ -1349,6 +1502,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; reportActionID: string; }; @@ -1358,6 +1512,7 @@ type MoneyRequestNavigatorParamList = { transactionID: string; reportActionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_TAX_AMOUNT]: { @@ -1365,6 +1520,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; currency?: string; }; @@ -1373,6 +1529,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; reportActionID: string; orderWeight: string; @@ -1382,11 +1539,14 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_WAYPOINT]: { iouType: IOUType; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; action: IOUAction; pageIndex: string; @@ -1397,6 +1557,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; reportActionID?: string; }; @@ -1405,6 +1566,7 @@ type MoneyRequestNavigatorParamList = { iouType: ValueOf; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.IOU_SEND.ENABLE_PAYMENTS]: undefined; @@ -1415,6 +1577,7 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; backToReport?: string; reportActionID?: string; @@ -1424,6 +1587,7 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; backToReport?: string; reportActionID?: string; @@ -1433,6 +1597,7 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; backToReport?: string; reportActionID?: string; @@ -1444,6 +1609,7 @@ type MoneyRequestNavigatorParamList = { // These are not used in the screen, but are needed for the navigation // for IOURequestStepDistance and IOURequestStepAmount components + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: never; action: never; currency: never; @@ -1461,6 +1627,7 @@ type MoneyRequestNavigatorParamList = { iouType: IOUType; reportID: string; transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; action: IOUAction; pageIndex?: string; @@ -1472,6 +1639,7 @@ type MoneyRequestNavigatorParamList = { action: IOUAction; iouType: ValueOf; transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; reportID: string; reportActionID?: string; @@ -1482,6 +1650,7 @@ type MoneyRequestNavigatorParamList = { transactionID: string; reportID: string; pageIndex?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; participantsAutoAssigned?: string; backToReport?: string; @@ -1492,11 +1661,13 @@ type MoneyRequestNavigatorParamList = { transactionID: string; reportID: string; pageIndex: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; backToReport?: string; }; [SCREENS.MONEY_REQUEST.RECEIPT_VIEW]: { transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_CURRENCY]: { @@ -1505,6 +1676,7 @@ type MoneyRequestNavigatorParamList = { transactionID: string; reportID: string; pageIndex?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; currency?: string; }; @@ -1516,6 +1688,7 @@ type MoneyRequestNavigatorParamList = { reportID: string; /** Link to previous page */ + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: ExpensifyRoute; /** Hash that includes info about what is searched for */ @@ -1529,6 +1702,7 @@ type MoneyRequestNavigatorParamList = { reportID: string; /** Link to previous page */ + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: ExpensifyRoute; }; [SCREENS.MONEY_REQUEST.STEP_ATTENDEES]: { @@ -1536,6 +1710,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_ACCOUNTANT]: { @@ -1543,6 +1718,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; }; [SCREENS.MONEY_REQUEST.STEP_UPGRADE]: { @@ -1550,6 +1726,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; upgradePath?: ValueOf; shouldSubmitExpense?: boolean; @@ -1559,6 +1736,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; }; [SCREENS.MONEY_REQUEST.STEP_TIME]: { @@ -1566,11 +1744,13 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; }; [SCREENS.MONEY_REQUEST.STEP_SUBRATE]: { iouType: Exclude; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; action: IOUAction; pageIndex: string; @@ -1581,6 +1761,7 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; }; [SCREENS.MONEY_REQUEST.STEP_TIME_EDIT]: { @@ -1588,11 +1769,13 @@ type MoneyRequestNavigatorParamList = { iouType: Exclude; transactionID: string; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; }; [SCREENS.MONEY_REQUEST.STEP_SUBRATE_EDIT]: { iouType: Exclude; reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes | undefined; action: IOUAction; pageIndex: string; @@ -1605,6 +1788,7 @@ type MoneyRequestNavigatorParamList = { // These are not used in the screen, but are needed for the navigation // for IOURequestStepDistanceMap component + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: never; action: never; currency: never; @@ -1616,6 +1800,7 @@ type MoneyRequestNavigatorParamList = { type WorkspaceConfirmationNavigatorParamList = { [SCREENS.WORKSPACE_CONFIRMATION.ROOT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.CURRENCY.SELECTION]: { @@ -1634,19 +1819,24 @@ type WorkspaceDuplicateNavigatorParamList = { type NewTaskNavigatorParamList = { [SCREENS.NEW_TASK.ROOT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.NEW_TASK.TASK_ASSIGNEE_SELECTOR]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.NEW_TASK.TASK_SHARE_DESTINATION_SELECTOR]: undefined; [SCREENS.NEW_TASK.DETAILS]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.NEW_TASK.TITLE]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.NEW_TASK.DESCRIPTION]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1660,10 +1850,12 @@ type TeachersUniteNavigatorParamList = { type TaskDetailsNavigatorParamList = { [SCREENS.TASK.TITLE]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TASK.ASSIGNEE]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1676,6 +1868,7 @@ type SplitDetailsNavigatorParamList = { [SCREENS.SPLIT_DETAILS.ROOT]: { reportID: string; reportActionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SPLIT_DETAILS.EDIT_REQUEST]: { @@ -1694,6 +1887,7 @@ type AddPersonalBankAccountNavigatorParamList = { type ReimbursementAccountNavigatorParamList = { [SCREENS.REIMBURSEMENT_ACCOUNT_ROOT]: { stepToOpen?: ReimbursementAccountStepToOpen; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; policyID?: string; }; @@ -1718,6 +1912,7 @@ type FlagCommentNavigatorParamList = { [SCREENS.FLAG_COMMENT_ROOT]: { reportID: string; reportActionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1727,6 +1922,7 @@ type EditRequestNavigatorParamList = { fieldID: string; reportID: string; policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1745,17 +1941,20 @@ type FeatureTrainingNavigatorParamList = { type ReferralDetailsNavigatorParamList = { [SCREENS.REFERRAL_DETAILS]: { contentType: ValueOf; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: string; }; }; type PrivateNotesNavigatorParamList = { [SCREENS.PRIVATE_NOTES.LIST]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.PRIVATE_NOTES.EDIT]: { reportID: string; accountID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1763,34 +1962,42 @@ type PrivateNotesNavigatorParamList = { type TransactionDuplicateNavigatorParamList = { [SCREENS.TRANSACTION_DUPLICATE.REVIEW]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.MERCHANT]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.CATEGORY]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.TAG]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.DESCRIPTION]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.TAX_CODE]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.BILLABLE]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRANSACTION_DUPLICATE.REIMBURSABLE]: { threadReportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1798,18 +2005,22 @@ type TransactionDuplicateNavigatorParamList = { type MergeTransactionNavigatorParamList = { [SCREENS.MERGE_TRANSACTION.LIST_PAGE]: { transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.MERGE_TRANSACTION.RECEIPT_PAGE]: { transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.MERGE_TRANSACTION.DETAILS_PAGE]: { transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.MERGE_TRANSACTION.CONFIRMATION_PAGE]: { transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1872,6 +2083,7 @@ type TravelNavigatorParamList = { [SCREENS.TRAVEL.TRIP_SUMMARY]: { reportID: string; transactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.TRAVEL.TRIP_DETAILS]: { @@ -1879,6 +2091,7 @@ type TravelNavigatorParamList = { transactionID: string; sequenceIndex: number; pnr: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.TRAVEL.TCS]: { @@ -1889,15 +2102,19 @@ type TravelNavigatorParamList = { }; [SCREENS.TRAVEL.WORKSPACE_ADDRESS]: { domain: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRAVEL.PUBLIC_DOMAIN_ERROR]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRAVEL.UPGRADE]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRAVEL.DOMAIN_SELECTOR]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.TRAVEL.VERIFY_ACCOUNT]: { @@ -1912,6 +2129,7 @@ type ReportsSplitNavigatorParamList = { reportActionID?: string; openOnAdminRoom?: boolean; referrer?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.ATTACHMENTS]: AttachmentModalScreensParamList[typeof SCREENS.ATTACHMENTS]; @@ -1922,22 +2140,28 @@ type SettingsSplitNavigatorParamList = { [SCREENS.SETTINGS.PREFERENCES.ROOT]: undefined; [SCREENS.SETTINGS.SECURITY]: undefined; [SCREENS.SETTINGS.PROFILE.ROOT]?: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS.WALLET.ROOT]: undefined; [SCREENS.SETTINGS.ABOUT]: undefined; [SCREENS.SETTINGS.TROUBLESHOOT]: undefined; [SCREENS.SETTINGS.SAVE_THE_WORLD]: undefined; - [SCREENS.SETTINGS.SUBSCRIPTION.ROOT]?: {backTo?: Routes}; + [SCREENS.SETTINGS.SUBSCRIPTION.ROOT]?: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md + backTo?: Routes; + }; }; type WorkspaceSplitNavigatorParamList = { [SCREENS.WORKSPACE.INITIAL]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.PROFILE]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.EXPENSIFY_CARD]: { @@ -1952,21 +2176,25 @@ type WorkspaceSplitNavigatorParamList = { [SCREENS.WORKSPACE.RECEIPT_PARTNERS_INVITE]: { policyID: string; integration: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.RECEIPT_PARTNERS_INVITE_EDIT]: { policyID: string; integration: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.COMPANY_CARDS_ADD_NEW]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.COMPANY_CARDS_TRANSACTION_START_DATE]: { policyID: string; feed: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.PER_DIEM]: { @@ -1977,6 +2205,7 @@ type WorkspaceSplitNavigatorParamList = { }; [SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_NEW]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_EDIT]: { @@ -1985,11 +2214,13 @@ type WorkspaceSplitNavigatorParamList = { }; [SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_EXPENSES_FROM]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_APPROVER]: { policyID: string; approverIndex: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.WORKFLOWS_AUTO_REPORTING_FREQUENCY]: { @@ -2012,10 +2243,12 @@ type WorkspaceSplitNavigatorParamList = { }; [SCREENS.WORKSPACE.CATEGORIES]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_CATEGORIES.SETTINGS_CATEGORIES_ROOT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.MORE_FEATURES]: { @@ -2023,10 +2256,12 @@ type WorkspaceSplitNavigatorParamList = { }; [SCREENS.WORKSPACE.TAGS]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS_TAGS.SETTINGS_TAGS_ROOT]: { policyID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE.TAXES]: { @@ -2069,42 +2304,55 @@ type WorkspaceSplitNavigatorParamList = { type OnboardingModalNavigatorParamList = { [SCREENS.ONBOARDING.PERSONAL_DETAILS]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.PRIVATE_DOMAIN]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORKSPACES]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.PURPOSE]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.EMPLOYEES]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.ACCOUNTING]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.INTERESTED_FEATURES]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORK_EMAIL]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORK_EMAIL_VALIDATION]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORKSPACE_OPTIONAL]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORKSPACE_CONFIRMATION]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORKSPACE_CURRENCY]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.ONBOARDING.WORKSPACE_INVITE]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; }; @@ -2207,6 +2455,7 @@ type AttachmentModalScreensParamList = { }; [SCREENS.PROFILE_AVATAR]: AttachmentModalContainerModalProps & { accountID: number; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE_AVATAR]: AttachmentModalContainerModalProps & { @@ -2241,6 +2490,7 @@ type AuthScreensParamList = SharedScreensParamList & [SCREENS.TRACK_EXPENSE]: undefined; [SCREENS.SUBMIT_EXPENSE]: undefined; [SCREENS.WORKSPACES_LIST]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.WORKSPACE_JOIN_USER]: { @@ -2271,6 +2521,7 @@ type SearchReportParamList = { [SCREENS.SEARCH.REPORT_RHP]: { reportID: string; reportActionID?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SEARCH.TRANSACTION_HOLD_REASON_RHP]: { @@ -2281,6 +2532,7 @@ type SearchReportParamList = { reportID: string; /** Link to previous page */ + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: ExpensifyRoute; /** Hash that includes info about what is searched for */ @@ -2288,6 +2540,7 @@ type SearchReportParamList = { }; [SCREENS.SEARCH.MONEY_REQUEST_REPORT_HOLD_TRANSACTIONS]: { /** Link to previous page */ + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo: Routes; /** Selected transactions' report ID */ reportID: string; @@ -2302,6 +2555,7 @@ type SearchFullscreenNavigatorParamList = { }; [SCREENS.SEARCH.MONEY_REQUEST_REPORT]: { reportID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -2329,12 +2583,14 @@ type SplitExpenseParamList = { reportID: string; transactionID: string; splitExpenseTransactionID?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.MONEY_REQUEST.SPLIT_EXPENSE_EDIT]: { reportID: string; transactionID: string; splitExpenseTransactionID: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -2362,11 +2618,13 @@ type DebugParamList = { fieldName: string; fieldValue?: string; policyID?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.DEBUG.DETAILS_DATE_TIME_PICKER_PAGE]: { fieldName: string; fieldValue?: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: string; }; [SCREENS.DEBUG.TRANSACTION]: { @@ -2401,6 +2659,7 @@ type ReportChangeApproverParamList = { type TestToolsModalModalNavigatorParamList = { [SCREENS.TEST_TOOLS_MODAL.ROOT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; From 2f3cd5c4ea10fad4a7a13e74fa0bf31266c2fc39 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 3 Oct 2025 13:49:41 +0200 Subject: [PATCH 2/7] Deprecate backTo in NAVIGATION.md --- .eslintrc.js | 5 +- contributingGuides/NAVIGATION.md | 109 +++++++++++++++++++++++++++++-- src/libs/Navigation/types.ts | 3 + 3 files changed, 109 insertions(+), 8 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index f8dbe866d554..5ffd8bc99206 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -274,7 +274,7 @@ module.exports = { { selector: 'CallExpression[callee.name="getUrlWithBackToParam"]', message: - 'Usage of getUrlWithBackToParam function is prohibited. This is legacy code and no new occurrences should be added. Please look into documentation and use alternative routing methods instead.', + 'Usage of getUrlWithBackToParam function is prohibited. This is legacy code and no new occurrences should be added. Please look into the `How to remove backTo from URL` section in contributingGuides/NAVIGATION.md. and use alternative routing methods instead.', }, // These are the original rules from AirBnB's style guide, modified to allow for...of loops and for...in loops @@ -359,7 +359,8 @@ module.exports = { 'error', { selector: 'TSPropertySignature[key.name="backTo"]', - message: 'The `backTo` route param is deprecated. Do not add new `backTo` properties to screen param lists. See contributingGuides/NAVIGATION.md.', + message: + 'The `backTo` route param is deprecated. Do not add new `backTo` properties to screen param lists. Please look into the `How to remove backTo from URL` section in contributingGuides/NAVIGATION.md. and use alternative routing methods instead.', }, ], }, diff --git a/contributingGuides/NAVIGATION.md b/contributingGuides/NAVIGATION.md index bad97b5b7494..be05e0d6b6b3 100644 --- a/contributingGuides/NAVIGATION.md +++ b/contributingGuides/NAVIGATION.md @@ -16,7 +16,9 @@ The navigation in the app is built on top of the `react-navigation` library. To - [Debugging](#debugging) - [Reading state when it changes](#reading-state-when-it-changes) - [Finding the code that calls the navigation function](#finding-the-code-that-calls-the-navigation-function) - - [Using `backTo` route param](#using-backto-route-param) + - [How to remove backTo from URL](#how-to-remove-backto-from-url) + - [Separate routes for each screen instance](#separate-routes-for-each-screen-instance) + - [Maintaining the order of screens in forms](#maintaining-the-order-of-screens-in-forms) - [Generating state from a path](#generating-state-from-a-path) - [Setting the correct screen underneath RHP](#setting-the-correct-screen-underneath-rhp) - [Performance solutions](#performance-solutions) @@ -71,7 +73,7 @@ Navigation.navigate( ); // Navigation with forceReplace - replaces current screen instead of pushing a new one -Navigation.navigate(ROUTES.SEARCH_REPORT.getRoute({reportID: nextReportID, backTo}), {forceReplace: true}); +Navigation.navigate(ROUTES.SETTINGS_WALLET, {forceReplace: true}); // Navigation with a callback to handle anonymous users interceptAnonymousUser(() => { @@ -434,10 +436,13 @@ const handleStateChange = (state: NavigationState | undefined) => { The easiest way to find the piece of code from which the navigation method was called is to use a debugger and breakpoints. You should attach a breakpoint in the navigation method and check the call stack, this way you can easily find the navigation method that caused the problem. -## Using `backTo` route param +## How to remove backTo from URL > [!WARNING] -> **Deprecated**: The `backTo` parameter is deprecated and should not be used in new implementations. Most problems that `backTo` solved can be resolved by adding one or more routes for a single screen. If you don't know how to solve your problem, contact someone from the navigation team. +> **Deprecated**: The `backTo` parameter is deprecated and should not be used in new implementations. Most problems that `backTo` solved can be resolved by adding one or more routes for a single screen. If you don't know how to solve your problem, contact someone from the navigation team. Old documentation on how to use `backTo` can be found below. + +
+Using `backTo` route param When a particular screen can be opened from two or more different pages, we can use `backTo` route parameter to handle such case. @@ -495,6 +500,98 @@ function NewSettingsScreen({route}: NewSettingsScreenNavigationProps) { ); } ``` +
+ +### Separate routes for each screen instance + +Often, you will need to reuse a single screen across multiple navigation flows. For example, the `ReportScreen` can be viewed in full screen width in the Inbox tab and in the Reports tab in the RHP. The proper approach to implementing such a mechanism is to create a new route for each screen instance within a single flow. + +Considerations when removing `backTo` from a URL: +- For RHP screens, check if the correct central screen is under the overlay after refreshing the page. More information on how to set the default screen underneath RHP can be found (here)[#setting-the-correct-screen-underneath-rhp]. +- Ensure that after refreshing the page and pressing the back button in the application, you return to the page from which you initially accessed the currently displayed screen. + +An example of a screen that is reused in two flows is `ReportScreen` (`src/pages/home/ReportScreen.tsx`): +1. Sharing types + +```ts +type ReportScreenNavigationProps = + | PlatformStackScreenProps + | PlatformStackScreenProps; +``` + +2. Binding one component to multiple screens + +`src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx` +```ts +const loadReportScreen = () => require('@pages/home/ReportScreen').default; + +return ( + + + // ... + + + + ); +``` + +3. Custom component behavior depending on the current route + +If we want the component's behavior to change based on the current route, we can implement this using the `route` property. We can use it to specify the correct return route after a refresh. + +```ts +import SCREENS from '@src/SCREENS'; +import type {ReportsSplitNavigatorParamList, SearchReportParamList} from '@navigation/types'; +import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; + +type ReportScreenNavigationProps = + | PlatformStackScreenProps + | PlatformStackScreenProps; + +function ReportScreen({route, navigation}: ReportScreenProps) { + + const customAction = () => { + if(route.name === SCREENS.SEARCH.REPORT_RHP) { + // do something when screen is SCREENS.SEARCH.REPORT_RHP + }else { + // do something when screen is SCREENS.REPORT + } + } +} +``` + +### Maintaining the order of screens in forms +Another case where maintaining the screen order after a refresh is important is in forms. There are several methods to achieve this: +1. For multi-step forms, append the values from each screen to the URL. This approach makes it easy to recreate the screen order with the appropriate values. + +We have a three-stage form where each screen is responsible for entering another value. + +Form fields: +- First name +- Last name +- Date of birth + +We should use the following url pattern: +- FirstNamePage: `/example-form/:firstName` +- LastNamePage: `/example-form/:firstName/:lastName` +- DateOfBirthPage: `/example-form/:firstName:/:lastName/:dateOfBirth` + +Thanks to this structure, we are able to easily recreate the order of screens with the appropriate values ​​in the form. + +2. Store form data in Onyx. +3. Reset the form to the first screen after a refresh. +If we do not want to preserve the form's values after a refresh, we should reset the form. To handle this properly, we can perform a replace on the current screen (replace it with the first screen in the form's sequence). + ## Generating state from a path @@ -507,7 +604,7 @@ In Expensify, we use an extended implementation of this function because: - When opening a link leading to an onboarding screen, all previous screens in this flow have to be present in the navigation state. - In case of opening the RHP, appropriate screens should be pushed to the navigation to be displayed below the overlay. A guide on how to set up a good screen for RHP can be found [here](#how-to-set-a-correct-screen-below-the-rhp). - When opening the settings of a specific workspace, the workspace list needs to be pushed to the state. -- When the `backTo` parameter is in the URL, we need to build a state also for the screen we want to return to. +- When the `backTo` parameter is in the URL, we need to build a state also for the screen we want to return to. (`backTo` parameter is deprecated, more information can be found [here](#how-to-properly-remove-backto-from-url)) Here are examples how the state is generated based on route: @@ -623,7 +720,7 @@ In the above example, we can see that when building a state from a link leading ## Setting the correct screen underneath RHP -RHP screens can usually be opened from a specific central screen. Of course there are cases where one RHP screen can be used in different tabs (then using `backTo` parameter comes in handy). However, most often one RHP screen has a specific central screen assigned underneath. +RHP screens can usually be opened from a specific central screen. Of course there are cases where one RHP screen can be used in different tabs. However, most often one RHP screen has a specific central screen assigned underneath. > [!WARNING] > **Deprecated**: The `backTo` parameter is deprecated and should not be used in new implementations. Most problems that `backTo` solved can be resolved by adding one or more routes for a single screen. If you don't know how to solve your problem, contact someone from the navigation team. diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 6c547f60e9df..e5f9bb8ee8a4 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1292,6 +1292,7 @@ type TwoFactorAuthNavigatorParamList = { forwardTo?: string; }; [SCREENS.TWO_FACTOR_AUTH.VERIFY_ACCOUNT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; forwardTo?: Routes; }; @@ -1335,6 +1336,7 @@ type ProfileNavigatorParamList = { type NewReportWorkspaceSelectionNavigatorParamList = { [SCREENS.NEW_REPORT_WORKSPACE_SELECTION.ROOT]: { isMovingExpenses?: boolean; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; @@ -1804,6 +1806,7 @@ type WorkspaceConfirmationNavigatorParamList = { backTo?: Routes; }; [SCREENS.CURRENCY.SELECTION]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; }; From 83927d383a0c5b4ef87fd47e48be79d3183aae4a Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 10 Oct 2025 11:50:11 +0200 Subject: [PATCH 3/7] Add fixes to NAVIGATION.md --- contributingGuides/NAVIGATION.md | 114 +++++++++++++++++++------------ 1 file changed, 69 insertions(+), 45 deletions(-) diff --git a/contributingGuides/NAVIGATION.md b/contributingGuides/NAVIGATION.md index be05e0d6b6b3..56d52ce6ed12 100644 --- a/contributingGuides/NAVIGATION.md +++ b/contributingGuides/NAVIGATION.md @@ -17,7 +17,7 @@ The navigation in the app is built on top of the `react-navigation` library. To - [Reading state when it changes](#reading-state-when-it-changes) - [Finding the code that calls the navigation function](#finding-the-code-that-calls-the-navigation-function) - [How to remove backTo from URL](#how-to-remove-backto-from-url) - - [Separate routes for each screen instance](#separate-routes-for-each-screen-instance) + - [Separating routes for each screen instance](#separating-routes-for-each-screen-instance) - [Maintaining the order of screens in forms](#maintaining-the-order-of-screens-in-forms) - [Generating state from a path](#generating-state-from-a-path) - [Setting the correct screen underneath RHP](#setting-the-correct-screen-underneath-rhp) @@ -502,16 +502,15 @@ function NewSettingsScreen({route}: NewSettingsScreenNavigationProps) { ``` -### Separate routes for each screen instance +### Separating routes for each screen instance -Often, you will need to reuse a single screen across multiple navigation flows. For example, the `ReportScreen` can be viewed in full screen width in the Inbox tab and in the Reports tab in the RHP. The proper approach to implementing such a mechanism is to create a new route for each screen instance within a single flow. +Often, you will need to reuse a single screen across multiple navigation flows. For example, the `VerifyAccountPage` can be viewed in many different RHP flows. The proper approach to implementing such a mechanism is to create a new route for each screen instance within a single flow. Considerations when removing `backTo` from a URL: + - For RHP screens, check if the correct central screen is under the overlay after refreshing the page. More information on how to set the default screen underneath RHP can be found (here)[#setting-the-correct-screen-underneath-rhp]. - Ensure that after refreshing the page and pressing the back button in the application, you return to the page from which you initially accessed the currently displayed screen. - -An example of a screen that is reused in two flows is `ReportScreen` (`src/pages/home/ReportScreen.tsx`): -1. Sharing types +- If you use the same component for different routes, be sure to define the correct props type. Here's the example of `ReportScreen` that can be viewed in full screen width in the Inbox tab and in the Reports tab in the RHP. ```ts type ReportScreenNavigationProps = @@ -519,55 +518,77 @@ type ReportScreenNavigationProps = | PlatformStackScreenProps; ``` -2. Binding one component to multiple screens +An example of a screen that is reused in several flows is `VerifyAccountPage`. + +1. Binding one component to multiple screens. + +`src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx` -`src/libs/Navigation/AppNavigator/Navigators/ReportsSplitNavigator.tsx` ```ts -const loadReportScreen = () => require('@pages/home/ReportScreen').default; - -return ( - - - // ... - - - - ); +const TravelModalStackNavigator = createModalStackNavigator({ + // ... + [SCREENS.TRAVEL.VERIFY_ACCOUNT]: () => require('../../../../pages/Travel/VerifyAccountPage').default, +}); + +const TwoFactorAuthenticatorStackNavigator = createModalStackNavigator({ + // ... + [SCREENS.TWO_FACTOR_AUTH.VERIFY_ACCOUNT]: () => require('../../../../pages/settings/Security/TwoFactorAuth/VerifyAccountPage').default, +}); ``` -3. Custom component behavior depending on the current route +2. Custom component behavior depending on the current route. -If we want the component's behavior to change based on the current route, we can implement this using the `route` property. We can use it to specify the correct return route after a refresh. +If we want the component's behavior to change based on the current route, we can extract the component shared by each route and pass properties to it that define the custom behavior, as is done for `VerifyAccountPage`. + +`VerifyAccountPageBase` is a shared component that receives `navigateBackTo` and `navigateForwardTo` props defining behavior that is custom across different flows. + +Here's an example of reusing this component for Wallet and Travel flows: + +1. `src/pages/settings/Wallet/VerifyAccountPage.tsx`. ```ts -import SCREENS from '@src/SCREENS'; -import type {ReportsSplitNavigatorParamList, SearchReportParamList} from '@navigation/types'; -import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; +import React from 'react'; +import VerifyAccountPageBase from '@pages/settings/VerifyAccountPageBase'; +import ROUTES from '@src/ROUTES'; -type ReportScreenNavigationProps = - | PlatformStackScreenProps - | PlatformStackScreenProps; +function VerifyAccountPage() { + return ( + + ); +} -function ReportScreen({route, navigation}: ReportScreenProps) { +VerifyAccountPage.displayName = 'VerifyAccountPage'; - const customAction = () => { - if(route.name === SCREENS.SEARCH.REPORT_RHP) { - // do something when screen is SCREENS.SEARCH.REPORT_RHP - }else { - // do something when screen is SCREENS.REPORT - } - } +export default VerifyAccountPage; +``` + +2. `src/pages/Travel/VerifyAccountPage.tsx`. + +```ts +import type {StackScreenProps} from '@react-navigation/stack'; +import React from 'react'; +import type {TravelNavigatorParamList} from '@libs/Navigation/types'; +import VerifyAccountPageBase from '@pages/settings/VerifyAccountPageBase'; +import ROUTES from '@src/ROUTES'; +import type SCREENS from '@src/SCREENS'; + +type VerifyAccountPageProps = StackScreenProps; + +function VerifyAccountPage({route}: VerifyAccountPageProps) { + return ( + + ); } + +VerifyAccountPage.displayName = 'VerifyAccountPage'; +export default VerifyAccountPage; + ``` ### Maintaining the order of screens in forms @@ -588,11 +609,14 @@ We should use the following url pattern: Thanks to this structure, we are able to easily recreate the order of screens with the appropriate values ​​in the form. +> [!WARNING] +> This approach is not suggested for more complex forms with a large number of inputs. + + 2. Store form data in Onyx. 3. Reset the form to the first screen after a refresh. If we do not want to preserve the form's values after a refresh, we should reset the form. To handle this properly, we can perform a replace on the current screen (replace it with the first screen in the form's sequence). - ## Generating state from a path In the following section, you will find information on how the navigation state is generated from the URL. From 61c17f2d3cc7795db3e08c4469004bad6dfb3ea7 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Wed, 15 Oct 2025 11:57:47 +0200 Subject: [PATCH 4/7] Fix types --- src/libs/Navigation/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 4f378ab49522..590e598a32bc 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -114,6 +114,7 @@ type SettingsNavigatorParamList = { }; [SCREENS.SETTINGS.PROFILE.NEW_CONTACT_METHOD_CONFIRM_MAGIC_CODE]: { newContactMethod: string; + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; [SCREENS.SETTINGS.PROFILE.CONTACT_METHOD_VERIFY_ACCOUNT]: { From 5a3937e864c4b589d2f6de14cdda288960177d00 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Thu, 16 Oct 2025 08:41:46 +0200 Subject: [PATCH 5/7] Format NAVIGATION.md --- contributingGuides/NAVIGATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contributingGuides/NAVIGATION.md b/contributingGuides/NAVIGATION.md index 56d52ce6ed12..c297f8c9ed19 100644 --- a/contributingGuides/NAVIGATION.md +++ b/contributingGuides/NAVIGATION.md @@ -439,7 +439,7 @@ The easiest way to find the piece of code from which the navigation method was c ## How to remove backTo from URL > [!WARNING] -> **Deprecated**: The `backTo` parameter is deprecated and should not be used in new implementations. Most problems that `backTo` solved can be resolved by adding one or more routes for a single screen. If you don't know how to solve your problem, contact someone from the navigation team. Old documentation on how to use `backTo` can be found below. +> **Deprecated**: The `backTo` parameter is deprecated and should not be used in new implementations. Most problems that `backTo` solved can be resolved by adding one or more routes for a single screen. If you don't know how to solve your problem, contact someone from the navigation team. Old documentation on how to use `backTo` can be found below.
Using `backTo` route param From 793c315988b6ec68bdc96948b70f0d583cf91cc6 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Thu, 16 Oct 2025 11:16:57 +0200 Subject: [PATCH 6/7] Remove section: Maintaining the order of screens in forms --- contributingGuides/NAVIGATION.md | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/contributingGuides/NAVIGATION.md b/contributingGuides/NAVIGATION.md index c297f8c9ed19..6926c3da2420 100644 --- a/contributingGuides/NAVIGATION.md +++ b/contributingGuides/NAVIGATION.md @@ -18,7 +18,6 @@ The navigation in the app is built on top of the `react-navigation` library. To - [Finding the code that calls the navigation function](#finding-the-code-that-calls-the-navigation-function) - [How to remove backTo from URL](#how-to-remove-backto-from-url) - [Separating routes for each screen instance](#separating-routes-for-each-screen-instance) - - [Maintaining the order of screens in forms](#maintaining-the-order-of-screens-in-forms) - [Generating state from a path](#generating-state-from-a-path) - [Setting the correct screen underneath RHP](#setting-the-correct-screen-underneath-rhp) - [Performance solutions](#performance-solutions) @@ -591,32 +590,6 @@ export default VerifyAccountPage; ``` -### Maintaining the order of screens in forms -Another case where maintaining the screen order after a refresh is important is in forms. There are several methods to achieve this: -1. For multi-step forms, append the values from each screen to the URL. This approach makes it easy to recreate the screen order with the appropriate values. - -We have a three-stage form where each screen is responsible for entering another value. - -Form fields: -- First name -- Last name -- Date of birth - -We should use the following url pattern: -- FirstNamePage: `/example-form/:firstName` -- LastNamePage: `/example-form/:firstName/:lastName` -- DateOfBirthPage: `/example-form/:firstName:/:lastName/:dateOfBirth` - -Thanks to this structure, we are able to easily recreate the order of screens with the appropriate values ​​in the form. - -> [!WARNING] -> This approach is not suggested for more complex forms with a large number of inputs. - - -2. Store form data in Onyx. -3. Reset the form to the first screen after a refresh. -If we do not want to preserve the form's values after a refresh, we should reset the form. To handle this properly, we can perform a replace on the current screen (replace it with the first screen in the form's sequence). - ## Generating state from a path In the following section, you will find information on how the navigation state is generated from the URL. From f70c22450d8a4a086762cde1e6a1f09d48fe17c1 Mon Sep 17 00:00:00 2001 From: Wojciech Boman Date: Fri, 17 Oct 2025 14:29:09 +0200 Subject: [PATCH 7/7] Fix eslint --- src/libs/Navigation/types.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index c1f1b792c383..936db21927a9 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -1348,6 +1348,7 @@ type NewReportWorkspaceSelectionNavigatorParamList = { type SetDefaultWorkspaceNavigatorParamList = { [SCREENS.SET_DEFAULT_WORKSPACE.ROOT]: { + // eslint-disable-next-line no-restricted-syntax -- `backTo` usages in this file are legacy. Do not add new `backTo` params to screens. See contributingGuides/NAVIGATION.md backTo?: Routes; }; };