Hacker News new | past | comments | ask | show | jobs | submit login

So what you are saying is that if you want to show/hide something dynamically on the webpage you should use React? lol

Also, maybe it is from lack of experience. Because you can add classes to your elements and depending on them you can hide/show all of them with just

  $('.toggle-element').toggle();



Well it gets more complex when there’s more business rules. Like if you have 1 checkbox checked need to show this one bit but if you have 2 need to show all of them. It’s just an example.

Trying to scope it all gets a bit unruly too. Your example would target every element on the page. If you have nested components it’s a nightmare.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: