15 lines
475 B
TypeScript
15 lines
475 B
TypeScript
import { useNavigation } from "expo-router"
|
|
import { StackActions } from "expo-router/react-navigation"
|
|
import { useCallback } from "react"
|
|
|
|
/** Present the app-level modal without resolving an overlapping tab settings route. */
|
|
export function useOpenSettings() {
|
|
const navigation = useNavigation("/(app)")
|
|
return useCallback(() => {
|
|
navigation.dispatch({
|
|
...StackActions.push("settings"),
|
|
target: navigation.getState()?.key,
|
|
})
|
|
}, [navigation])
|
|
}
|