Routing is just another way of fixing some content dynamically as part of your application.It is a key part of all websites and web applications in one way or another.
It plays a central role in static HTML pages as well as in the most complex React web applications. Routing comes into play whenever you want to use a URL in your application.
Routing is an important part of modern web applications. If want to build a web app that allows users to create custom fundraising pages to raise money for important causes, you’ll need routing for quite a few reasons, including:
- In general, to allow people to provide external links to your web app
- Public fundraising pages need to be reliably accessible by everyone, and you need a URL that’ll route them to the right page
- Different parts of the admin interface require it. Users need to be able to move forward and backward in their browsing history
- Different parts of your site need their own URL, allowing you to route people to the right section (for example, /settings, /profile, /pricing)
- Breaking up your code by page helps promote modularity and lets you break up your app.
Routing generally does three things:
1.Get to the location. (hashed URL).
2.Get new content(view/html)
3.inject into current(page's) html/DOM.
However, Routing is most commonly used for single page application that divides application into several logical parts(views) and based on navigation these view or pages will be fetched individually or independently.
[Note] : Whenever i say routing it is not only available in the client side but also available at the server side.