Routing and navigating

With the React router, you just used a <Link> component to navigate from one page to another, or used methods to programmatically open a different page. In RN, there is a different way of working, and the react-navigation package is practically the de facto standard. Here, you define a navigator (there are several kinds to pick from) and provide it with the screens (views) that it should handle, and then forget about it! The navigator will handle everything on its own, showing and hiding screens, adding tabs or a sliding drawer, or whatever it needs, and you don't have to do anything extra! 

In this recipe, we'll revisit an example from earlier pages of this book, and show how the router is written differently, to highlight differences in style.

There's more to navigation than what we'll see here. Check out the API documentation at https://reactnavigation.org/docs/en/api-reference.html for more, and beware if you Google around, because the react-navigation package has evolved, and many sites have references to old methods that are currently deprecated.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset