Member-only story
The Love-Hate Relationship between React Router and React Components

As React developers, a majority of us enjoy working with React Router and how well it fits our React application.
Why we ❤️ React Router:
- Works perfectly with React and follows the same principles
- The navigational aspect of the Router is really easy to understand
- Component composition, declarative UI, state management and how closely it follows React’s main flow (event => state change => re-render)
- Reliable browsing history feature that allows users to navigate throughout the app while keeping track of the view state
However, you will face some roadblocks while using React Router if your application-specific needs become a little more complicated than the regular usage you see on every tutorial on the web.
The good news is that even in those scenarios, React Router still allows us to solve problems in a clean way; but the solution might not be as obvious at first glance. Before we dive into this specific issue and how we solved it, Lets us talk about a few aspects of the great relationship between React Router and React Components.
Tip: Use Bit (GitHub) for your components. It will help you organize, share, and reuse them between apps to build faster…