refactor: remove ScreenComponent any cast from Perps routes#28116
refactor: remove ScreenComponent any cast from Perps routes#28116
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. |
Simplify PerpsConfirmScreen to rely solely on useRoute() hook, removing the redundant route prop type and the type ScreenComponent = React.ComponentType<any> escape hatch. Made-with: Cursor
bc64a87 to
7d24b49
Compare
|
Closing: rebasing onto main since the navigation v6 branch was merged. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Tags selected:
No performance impact expected from this change (it's a routing/component simplification with no rendering overhead changes). Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
Simplify the
PerpsConfirmScreenwrapper to rely solely onuseRoute()hook (which it was already using), removing the redundantrouteprop type and thetype ScreenComponent = React.ComponentType<any>escape hatch.Part of the React Navigation v6 migration effort to remove
no-explicit-anyviolations from route files.Changes:
routes/index.tsx: RemoveroutefromPerpsConfirmScreenprops, rely onuseRoute()only. RemoveScreenComponenttype alias andas ScreenComponentcast.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
Pre-merge reviewer checklist
Made with Cursor
Note
Low Risk
Low risk refactor limited to React Navigation wiring and TypeScript types; behavior should remain the same aside from how
showPerpsHeaderis read from route params.Overview
Simplifies
PerpsConfirmScreento no longer accept/forward navigation props and instead readshowPerpsHeaderdirectly fromuseRoute()params when renderingConfirm.Removes the
ScreenComponent = React.ComponentType<any>escape hatch and theas ScreenComponentcast in the stack screen registration, improving typing as part of the React Navigation v6 migration.Written by Cursor Bugbot for commit 6de9b09. This will update automatically on new commits. Configure here.