Skip to content

replace unsafe useNavigation casts with typed hook#29237

Merged
chrisnojima merged 1 commit into
nojima/HOTPOT-next-670-clean-2from
nojima/HOTPOT-better-use-nav-typing
May 22, 2026
Merged

replace unsafe useNavigation casts with typed hook#29237
chrisnojima merged 1 commit into
nojima/HOTPOT-next-670-clean-2from
nojima/HOTPOT-better-use-nav-typing

Conversation

@chrisnojima
Copy link
Copy Markdown
Contributor

Add useTypedNavigation('routeName') in util/typed-navigation.tsx that returns NativeStackNavigationProp<RootParamList, RouteName>, giving real typing for setParams/setOptions derived from the global route definitions rather than local duplicated ParamList types that could drift. Remove 12 local *ParamList type definitions and all the as-unknown-as / single-as casts they required.

Add useTypedNavigation('routeName') in util/typed-navigation.tsx that returns
NativeStackNavigationProp<RootParamList, RouteName>, giving real typing for
setParams/setOptions derived from the global route definitions rather than
local duplicated ParamList types that could drift. Remove 12 local *ParamList
type definitions and all the as-unknown-as / single-as casts they required.
@chrisnojima chrisnojima merged commit 31b0247 into nojima/HOTPOT-next-670-clean-2 May 22, 2026
1 check was pending
@chrisnojima chrisnojima deleted the nojima/HOTPOT-better-use-nav-typing branch May 22, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant