muicss / mui

Lightweight CSS framework
https://www.muicss.com
Other
4.51k stars 426 forks source link

MUI React - render of non-active tabs #260

Open accetone opened 6 years ago

accetone commented 6 years ago

Hi @amorey,

I noticed that all tabs rendered regardless of which is now active and then hid by CSS. Is the any reason for this? I think this can cause performance penalty.

amorey commented 6 years ago

I can't recall the thinking behind that choice but performance should depend on tab content and expected user tabbing frequency so I don't think there's necessarily a performance penalty. Another thing to consider is that pre-rendered content is better for SEO which is important to keep in mind when using server-side React (which some MUI users do). Have you run into performance issues with tabs?

accetone commented 6 years ago

Thanks for the answer. I don't face performance issues. Agree that decreasing of performance are depend on content of tabs. My concern was about speed of initial render. I was a bit puzzled when recognize that all tabs rendered at app start, so decided to open this issue. SEO is a good point to keep this behavior. Maybe should paste the note into documentation to keep users informed? What do you think?

amorey commented 6 years ago

Sure - that's a good suggestion. I can add a note to the tabs documentation.