expo / router

[ARCHIVE]: Expo Router has moved to expo/expo -- The File-based router for universal React Native apps

Home Page:https://docs.expo.dev/routing/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] What is the difference between useRouter and useNavigation?

devoren opened this issue · comments

Which package manager are you using? (Yarn is recommended)

yarn

Summary

What is the diffrence between useRouter and useNavigation? When to use useRouter and useNavigation? Can we use useNavigation instead of useRouter on web? Does useNavigation work the same as useNavigation from react-navigation? We also have useRootNavigation. Can we use useRootNavigation instead useRouter when we have this problem:
The action 'NAVIGATE' with payload was not handled by any navigator

Minimal reproducible example

const navigation = useNavigation();
const router= useRouter();