O'Reilly logo

React and React Native by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Handling Navigation with Routes

Almost every web application requires routing. It is the process of responding to a given URL, based on a set of route configurations. A simple mapping, in other words, from the URL to rendered content. However, this simple task is more involved than it seems at first. This is why we're going to leverage the react-router package in this chapter, the de facto routing tool for React.

First, you'll learn the basics of declaring routes using JSX syntax. Then, we'll dig into the dynamic aspects of routing, such as dynamic path segments and query parameters. Next, you'll implement links using components from react-router. We'll close the chapter with an example that shows you how to lazy-load your components ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required