Hey guys so i am using react-router-dom Navlink to naviagte from one page to another. Here i am having two pages on the routes as
- /dashboard/school
2./dashboard/civil-services
so lets say if i am on /dashboard/school and then i use NavLink to navigate it to /dashboard/civil-services like
<NavLink
exact
className={`${styles.ProfileMenuList} `}
activeClassName={`${styles.activeLink}`}
to="/dashboard/civil-services"
>
</NavLink>
the route gets change, but the data is not refetched, after i refresh the page then data is shown correctly
the Route component is defined in the following way
<BrowserRouter style={{ overflow: "auto" }}>
<Scroll>
<Switch>
<Route
exact
path="/dashboard/:type"
component={DashboardComponent}
/>
</Switch>
</Scroll
</BrowserRouter>
and in that component i am first checking the params value and fetchin data acc. to it.
P.s - I am not using redux here
this.props.match.params.type