Skip to content
Advertisement

remove # from url react-router-dom in react js

I am new in react.js I am using react-router-dom v6 and I working on a theme where I find an issue with # in URL

Example:- {url}/#/dashboard

I want Example:- {url}/dashboard

Advertisement

Answer

am assuming, you are using HashRouter if yes then please use BrowserRouter instead HashRouter

implement BrowserRouter on routing

import { BrowserRouter,Route, Routes } from 'react-router-dom'
render(
<BrowserRouter>
<Routes>....</Routes>
</BrowserRouter>)
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement