chore: migrate StackNavigationProp types to native-stack equivalents#32119
chore: migrate StackNavigationProp types to native-stack equivalents#32119weitingsun wants to merge 6 commits into
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
…aMask/metamask-mobile into wsun/clean-up-react-navigation-stack
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key changes analyzed:
Tags selected:
The native stack navigator has different transition animations, gesture handling, and header behavior compared to the JS stack navigator. The Performance Test Selection: |
Description
Replaces remaining @react-navigation/stack type usage with native-stack-aligned types now that the app runs on createNativeStackNavigator. This PR is type-only for production code — no navigator or screen transition behavior changes.
Changelog
CHANGELOG entry:null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-586
Manual testing steps
N/A - the changes are limited to tests and type changes, no functional changes
Screenshots/Recordings
n/a
Before
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Low Risk
Mostly TypeScript and test infrastructure; the ramps settings callback is a small UX timing change with no auth or transaction impact.
Overview
Aligns remaining navigation typing and test harnesses with native stack now that the main app uses
createNativeStackNavigator.Production screens and hooks stop importing
StackNavigationPropfrom@react-navigation/stackand instead useAppNavigationProp(general navigation),AppStackNavigationProp(stack APIs likereplace/pop),NativeStackNavigationPropwhere a feature param list is scoped (e.g. Predict), orNavigationPropfor typed sub-stacks (e.g. ramps).NavigationService/typesaddsAppStackNavigationPropas the typed native-stack variant with the same safegetState()override asAppNavigationProp.Tests, Storybook, and shared render helpers swap
createStackNavigatorforcreateNativeStackNavigatorand drop redundant stack mocks where native-stack is mocked instead.testSetup.jsmocksreact-native-screensso native-stack navigators unmount cleanly under Jest.The only non-type production behavior change is in ramps settings: “View order history” now
navigates inside the bottom sheet close callback so navigation runs after the sheet dismisses.Reviewed by Cursor Bugbot for commit bb4b8e4. Bugbot is set up for automated code reviews on this repo. Configure here.