expo-duooomi-app/utils/index.ts

26 lines
623 B
TypeScript

import { router } from 'expo-router'
import { Dimensions } from 'react-native'
export const screenWidth = Dimensions.get('window').width
export const screenHeight = Dimensions.get('window').height
export const push = (path: string, params?: Record<string, string | number>) => {
const params2 = params || {}
router.push({
pathname: path as any,
params: params2,
})
}
export const replace = (path: string, params?: Record<string, string | number>) => {
const params2 = params || {}
router.replace({
pathname: path as any,
params: params2,
})
}
export const goBack = () => {
router.back()
}