My router: url in the url bar changing but the component won't render

Hello everyone;
I am using NavLink to redirect users to the specified route but when i click on the NavItem the url in url bar will change but the view will still remain the same.
When i manually type into the url, the page will reload then take me to the component/view.

Here is my navigation item

import { NavLink } from 'react-router-dom'
  <NavLink to="/dashboard/me" className="navbar-content-li">
                    <FontAwesomeIcon icon={faChartPie}/>
                <NavLink to="/dashboard" className="navbar-content-li">
                    <FontAwesomeIcon icon={faCartPlus}/>
                <NavLink to="/dashboard" className="navbar-content-li">
                    <FontAwesomeIcon icon={faChartLine}/>
                <NavLink to="/dashboard/ecommerce" className="navbar-content-li">
                    <FontAwesomeIcon icon={faWallet}/>
                <NavLink to="/dashboard" className="navbar-content-li">
                    <FontAwesomeIcon icon={faComments}/>

the routers

import {BrowserRouter as Router, Switch, Route, withRouter} from "react-router-dom"
			<Router >
          			<Route path="/dashboard/ecommerce" component={withRouter(Ecommerce)}/>
					<Route path="/dashboard/me" component={withRouter(DashboardTop)}/>
					<Route path="/dashboard/myproduct" component={withRouter(Myproducts)}/>

I need help

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.