DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Simple React.js Routing for Beginners
Van Tran H.
Van Tran H.

Posted on

Simple React.js Routing for Beginners

One of the key parts of the modern single page application (SPA) is routing; determining what should show when a user visits a certain page in the application.

Simple React.js Routing for BeginnersSingle page applications are what their name suggests, just a single page that actuallyΒ looksΒ andΒ feelsΒ like multiple pages due to being built up of various components thatΒ renderΒ like separate pages. TheΒ routingΒ in these single page applications is the process and declaration of what specific components or pages the application should render based on theΒ URL,Β orΒ route.

RoutingΒ isΒ aΒ great way to ensure that your application remains clean, scalable and maintainable. In addition to this, it provides us with the ability to navigate through the application without the need to refresh the page, and therefore removes the β€œblank page flash” that we get when we move from page to page as the screen refreshes; ultimately offering an enhanced user experience as the application feels smoother, faster and more pleasant to use.

In this tutorial I’ll be introducing the basics to routing in React.js, and how we can implementΒ React RouterΒ to render specific components when we’re on a specific route in the application.Β 

Top comments (0)

🌚 Browsing with dark mode makes you a better developer by a factor of exactly 40.

It's a scientific fact.