-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Labels
InternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2
Description
Description
Current State:
- Dynamic routes do not propagate parameters from the base route into the dynamic suffix's navigation state
- When a dynamic suffix screen needs access to a parameter from the base route (e.g.,
reportIDfromr/:reportID), there is no built-in way to access it - This leads to workarounds such as custom hooks to extract parameters from the URL, as seen in migrate REPORT_SETTINGS_NAME #85034
Expected State:
- Parameters from the base route should be automatically derived and propagated into the dynamic suffix screen's navigation state
- For example, when navigating to
r/123456/verify-account, theverify-accountdynamic screen should receivereportID: 123456as a derived parameter without requiring additional hooks - This eliminates the need for workarounds and simplifies dynamic route consumption
Implementation:
- When building navigation state for a dynamic suffix in
getAdaptedStateFromPath, extract parameters from the resolved base route state - Propagate these derived parameters into the dynamic suffix screen's
params - Define which parameters should be propagated in the
DYNAMIC_ROUTESconfiguration (or derive them automatically from the base route's param list) - Update the
DynamicVerifyAccountPageand similar components to consume derived params directly from route params
Context:
- Discovered during migrate REPORT_SETTINGS_NAME #85034 where
reportIDis needed from the base route - Currently requires an additional hook to extract the parameter, which this feature would eliminate
Scope
Files:
App/src/libs/Navigation/helpers/getAdaptedStateFromPath.ts- Propagate base route params to dynamic suffix stateApp/src/ROUTES.ts- Optionally define derived parameter mappings inDYNAMIC_ROUTESApp/src/libs/Navigation/types.ts- Update dynamic route param types to include derived params- Dynamic route components that need base route parameters
Dependencies:
- [Due for payment 2026-02-17] [BT-001] Add Dynamic Routes Configuration #80906
- [BT-003] Intercept and Validate Dynamic Suffixes #80908
Issue Owner
Current Issue Owner: @collectioneurReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
InternalRequires API changes or must be handled by Expensify staffRequires API changes or must be handled by Expensify staffReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2