Scalable Protected Routes with React Router
How to reroute users to a public login page when they try to access protected routes.
Background
React-Router is the go-to standard for routing with react. it allows you to specify which components you want to render for each url in the application, and makes sure that your app will rerender when the user navigates to a new page. If you haven’t been exposed to React-Router I would recommend starting with the basics here.