Summary
React Router gives us a comprehensive set of components for managing the navigation between pages in our app. We learned that the top-level component is Router, which looks for Route components beneath it where we define what components should be rendered for certain paths.
The Link component allows us to link to different pages with an app. We learned that the NavLink component is like Link, but it includes the ability to style it depending on whether it is the active path or not. So, NavLink is perfect for the main navigation element in an app and Link is great for other links that appear on pages.
RouteComponentProps is a type that gives us access to route parameters and query parameters. We discovered that React Router doesn't ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access