Skip to content

Hiding elements best practices #450

Answered by sirenkovladd
HEAVYPOLY asked this question in Q&A
Discussion options

You must be logged in to vote

For hiding elements with very complicated content like a scrollable menu with lots of images or sliders, conditional rendering (Option 2) is the more efficient and recommended approach in VanJS and other modern web frameworks. It avoids unnecessary resource consumption by ensuring that the heavy components are only mounted to the DOM when they are actually needed.

@google-gemini

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@HEAVYPOLY
Comment options

@Tao-VanJS
Comment options

Answer selected by Tao-VanJS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants