gracekrcx / weekly-notes

4 stars 0 forks source link

(筆記)react navigation #115

Open gracekrcx opened 3 years ago

gracekrcx commented 3 years ago

Fundamentals

moving between screens

Let's break this down:

Passing parameters to routes

用 route 去接 parameters route.params

API Reference

Navigation prop

Each screen component in your app is provided with the navigation prop automatically.

Navigators

Native Stack Navigator

Hooks

useNavigation

如果 component 拿不到 navigation object 可以使用 useNavigation

useRoute

useRoute is a hook which gives access to route object.

gracekrcx commented 3 years ago

Stack Navigator 和 Native Stack Navigator 差別?