List page not Rerendering

I have modules listed in sider ,when i click on alredy selected sider it shouild rerender but it is not. i want the list to rerender if i select it again.
4 Replies
kapa.ai
kapa.ai10mo ago
Hi @MarcoNix. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the information provided in the extracts, the Sider component in Refine has a prop called activeItemDisabled which controls whether clicking on an active sider item should reload the page. If you set activeItemDisabled to false, the page should reload when you click on an already selected item in the Sider. Here is an example of how to use the activeItemDisabled prop:
<Sider
activeItemDisabled={false}
render={({ items, logout, collapsed }) => {
return (
<>
<div>My Custom Element</div>
{items}
{logout}
</>
);
}}
/>
<Sider
activeItemDisabled={false}
render={({ items, logout, collapsed }) => {
return (
<>
<div>My Custom Element</div>
{items}
{logout}
</>
);
}}
/>
In this example, setting activeItemDisabled to false means that clicking on an active item in the Sider will reload the page. For more information, you can refer to the Refine Sider Documentation (https://refine.dev/docs/api-reference/mui/components/mui-themed-layout/). ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai10mo ago
<@942824607818317905> kapa.ai is still learning and improving, please let us know how it did by reacting below
rival-black
rival-black10mo ago
<Sider /> is using link https://github.com/refinedev/refine/blob/next/packages/mui/src/components/themedLayoutV2/sider/index.tsx#L227 due to nature of routing libraries, route can't change if link is same as current pathname In this case, unfortunately, you have to swizzle the sider and handle the route programmatically.
metropolitan-bronze
metropolitan-bronze10mo ago
@alicanerdurmaz Why am trying to do this is because ,i have added a filter to the listing page ,when i come from another page the listing works and at that time when i click on the same listing icon it wont rerun api call. I try customizing the link ,but when i click on the module button makes complete app re render