Commit 8aa5a56
authored
refactor: remove ScreenComponent any cast from Ramp Deposit routes (MetaMask#28114)
## **Description**
Migrate the local `MainRoutes` component in Ramp Deposit routes from
prop-based route access to `useRoute()` hook, eliminating the `type
ScreenComponent = React.ComponentType<any>` escape hatch.
Part of the React Navigation v6 migration effort to remove
`no-explicit-any` violations from route files.
**Changes:**
- **`routes/index.tsx`**: Switch `MainRoutes` to `useRoute()`, remove
`MainRoutesProps`, `ScreenComponent` alias, and cast
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Fixes:
## **Manual testing steps**
N/A — pure refactoring with no user-facing behavior change.
## **Screenshots/Recordings**
### **Before**
N/A
### **After**
N/A
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Made with [Cursor](https://cursor.com)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk refactor limited to navigation param plumbing; behavior
should remain unchanged aside from potential typing/runtime differences
if the route context is misconfigured.
>
> **Overview**
> Refactors `app/components/UI/Ramp/Deposit/routes/index.tsx` so
`MainRoutes` no longer accepts a `route` prop and instead pulls
`DepositNavigationParams` from React Navigation via `useRoute()`.
>
> This removes the local `MainRoutesProps` typing and updates imports
accordingly, aiming to simplify typing and reduce `any`-style escape
hatches during the React Navigation v6 migration.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b1db237. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 0232dd7 commit 8aa5a56
1 file changed
Lines changed: 4 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
| |||
0 commit comments