How to Create a Navigation Bar With React-Router, Styled-Components, And Infrastructure-Components

Frank Zickert | Quantum Machine Learning
DailyJS
Published in
9 min readAug 15, 2019

--

Navigation must be functional! Photo by Alexander Andrews on Unsplash

TL;DR: Most tutorials focus on the design of navigation bars. They leave uncovered the functional aspects:

  • How do you create an app with routes to navigate to?
  • How do you populate the navigation bar with links to these routes?
  • How do you position the links (e.g. left-/right-aligned) depending on a custom characteristic of the route?
  • How do you highlight the page’s currently active route?

This hands-on tutorial focuses on these functional parts. But don’t worry. You can easily apply your great design to this functional navigation bar, too.

This post is the part of the book: React-Architect: Full-Stack React App Development and Serverless Deployment.

What do we expect from a navigation bar?

Navigation is a critical part of an application. New users do not know the structure of the app’s content. Self-Explanatory navigation helps them to find interesting content. Experienced users rely on the navigation to get to…

--

--

Frank Zickert | Quantum Machine Learning
DailyJS

You're interested in quantum computing and machine learning. But you don't know how to get started? Let me help