refactor: remove ScreenComponent any cast from Bridge routes#28113
refactor: remove ScreenComponent any cast from Bridge routes#28113
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. |
Migrate BlockExplorersModal from prop-based route access to useRoute() hook with typed RouteProp generic, eliminating the type ScreenComponent = React.ComponentType<any> escape hatch. Made-with: Cursor
7d74960 to
0a65ef5
Compare
|
Closing: rebasing onto main since the navigation v6 branch was merged. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Key observations:
SmokeTrade is selected because it covers bridge/swap flows including transaction details and history, which is where BlockExplorersModal is used. Per SmokeTrade's description, when selecting SmokeTrade for bridge flows, SmokeConfirmations should also be selected. However, since this is purely a UI refactoring of a modal that displays block explorer links (not the confirmation flow itself), and the risk is very low, SmokeConfirmations is included as a dependent tag per the tag description guidance. Performance Test Selection: |
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
Migrate BlockExplorersModal from prop-based route access to
useRoute()hook with typedRoutePropgeneric, eliminating thetype ScreenComponent = React.ComponentType<any>escape hatch from Bridge routes.Part of the React Navigation v6 migration effort to remove
no-explicit-anyviolations from route files.Changes:
BlockExplorersModal.tsx: Switch from(props: BlockExplorersModalProps)touseRoute()hookroutes.tsx: RemoveScreenComponenttype alias andas ScreenComponentcastBlockExplorersModal.test.tsx: MockuseRoute()instead of passing route as propChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
N/A — pure refactoring with no user-facing behavior change. Existing unit tests cover the affected component.
Screenshots/Recordings
Before
N/A
After
N/A
Pre-merge author checklist
Pre-merge reviewer checklist
Made with Cursor
Note
Low Risk
Low risk refactor limited to how route params are accessed and how tests set up navigation, with no expected behavioral changes beyond potential runtime issues if the route params are absent/mis-typed.
Overview
Refactors
BlockExplorersModalto stop accepting arouteprop and instead pullevmTxMeta/multiChainTxfrom React Navigation viauseRoute()with a typedRouteProp.Updates
BlockExplorersModal.test.tsxto mockuseRoute()and render the modal without passing route props, keeping existing assertions around explorer buttons and webview navigation.Written by Cursor Bugbot for commit f2cc0ca. This will update automatically on new commits. Configure here.