Navigating Between Screens
The focus of this chapter is on navigating between the screens that make up your React Native application. Navigation in native apps is slightly different than navigation on web apps: mainly because there isn’t any notion of a URL that the user is aware of. In prior versions of React Native, there were primitive navigator components that you could use to control the navigation between screens. There were a number of challenges with these components that resulted in more code to accomplish basic navigation tasks. For example, initial navigation components, like Navigator
and NavigatorIOS
, were complex to implement and lacked features, leading to performance issues and inconsistency across platforms.
More recent versions of React Native encourage you to use the react-navigation
package, which will be the focus of this chapter, even though there are several other options. You’ll learn about navigation basics, passing parameters to screens...