

Most importantly, HashRouter use cases aren't limited to SPA. React router renders a component that it was configured to render for /react/route, similarly to BrowserRouter. On client side, is parsed by React router. The setup cannot be backed up by server-side rendering because it's / path that is served on server side, #/react/route URL hash cannot be read from server side. Server-side routing is independent from client-side routing.īackward-compatible single-page application can use it as /#/react/route. It uses URL hash, it puts no limitations on supported browsers or web server. React router renders a component that it was configured to render for /react/route.Īdditionally, the setup may involve server-side rendering, index.html may contain rendered components or data that are specific to current route.

same index.html is served for /react/route path or any other route on server side. Usually this means that web server should be configured for single-page application, i.e. Client-side React application is able to maintain clean routes like /react/route but needs to be backed by web server. it's unavailable for legacy browsers (IE 9 and lower and contemporaries). Use it only if you need to support legacy browsers or don’t have server logic to handle the client side routes ❌Īs this technique is only intended to support legacy browsers, we encourage you to configure your server to work with BrowserHistory instead.It uses history API, i.e. This route isn’t recommended by the team who created react router package.It doesn’t need any configuration in server to handle routes ✅.It is used to support legacy browsers which usually doesn’t support HTML pushState API ✅.Hash value will be handled by react router. Hash portion of the URL won’t be handled by server, server will always send the index.html for every request and ignore hash value.Whenever, there is a new route get rendered, it updated the browser URL with hash routes.A router which uses client side hash routing.
