react-tabs icon indicating copy to clipboard operation
react-tabs copied to clipboard

Components Rendering Issue

Open makbar-hgsd opened this issue 4 years ago • 5 comments

I am rendering multiple components in different react-tabs but whenever I switch between those tabs my components gets re-render. Is there anyway to stop this re-rendering on switching tabs?

makbar-hgsd avatar Sep 26 '22 11:09 makbar-hgsd

Hi I am facing the same issue were you able to solve this if yes plz can you tell me how did you solved it thanks

geekynasir avatar Oct 20 '22 11:10 geekynasir

Try adding forceRenderTabPanel={true} to your <Tabs> component. That fixed a similar issue for me

tekisx avatar Nov 22 '22 01:11 tekisx

forceRenderTabPanel={true} renders all tabs at the same time,. So it solves the rendering issue, but creates another, making the tabs useless.

willnaoosmith avatar Dec 06 '22 13:12 willnaoosmith

forceRenderTabPanel={true} renders all tabs at the same time,. So it solves the rendering issue, but creates another, making the tabs useless.

The same

avfirsov avatar Dec 10 '24 19:12 avfirsov

The point of the forceRenderTabPanel feature is to enable you to determine when to display which panel. Note that you can also set forceRender on a per tab basis. Then it's up to you to hide and show the tab at the appropriate time, usually by applying styling rules (either directly or by e.g. toggling a CSS class) from within in the onSelect callback. Also note that even forceRendered panels will receive the selectedTabPanelClassName.

joepvl avatar Jan 07 '25 21:01 joepvl