Difference Between HashRouter and BrowserRouter
HashRouter | BrowserRouter |
---|---|
Uses URLs with a hash symbol eg (/#/about) | Uses cleaner URL without a hash ( eg : ‘/about’) |
It can uses in simpler application or static site deployments | Suitable for more complex application with server side rendering support |
import {HashRouter} from ‘react-router-dom’ ; | import {BrowserRouter} from ‘react-router-dom’ |
HashRouter in React Router
React Router is a library in React JS (Frontend Framework). It is commonly used for handling the navigation and routing in a web application.
In this post, we will learn about the “HashRouter” component provided by the React Router library.
Table of Content
- What is HashRouter?
- Features of HashRouter
- Difference Between HashRouter and BrowserRouter