I have a sidebar menu to change the page
I found that the page will not trigger re-render if I clicked the menu item that is current path.
(e.g. current path is /user and click the same path /user )
when entering the page it will call useEffect to get the data, but i want to click the same link again to reload the data instead of reloading the page
I have the following React router.
<Routes>
<Route path="" element={<MainLayout />}>
<Route path="/user" element={<User />} />
<Route path="/contact" element={<Contact />} />
<Route exact path="/" element={<Login />} />
</Route>
</Routes>
MainLayout.jsx
<Layout>
<Sidebar />
<Layout>
<Header></Header>
<Content >
<Outlet />
</Content>
<Footer >
Sorftware
</Footer>
</Layout>
</Layout>
Sidebar.jsx
<Menu>
<Menu.Item key="users" >
<Link to="/user">User</Link>
</Menu.Item>
</Menu>
*UPDATE :
I removed index.js
and CustomRouter.jsx
because it doesn't seem to be related to my question