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

In the past I would recommend React because it was exceedingly simple, but easily adaptable to any kind of complexity you might bring to it. Today, it is definitely more complex than it ought to be.

To be honest, I think it’s best to learn React without hooks first. Hooks are very confusing from the start, with far too many rules and too much ceremony for an API that looks simple. Without hooks:

- Most components are pure functions of props, which is why React was appealing in the first place

- You can manage state however you like, again React’s original value proposition

- You’re encouraged to actually isolate those cases! This is woefully uncommon in many React codebases.




Wow I didn't even know thats possible.

On the isolation part, I feel like if Hooks were taught in a bit of a different way particularly with the isolation example, it would probably be less scary. I learned something new today :)


I think it's not react that's complex. react ecosystem is very complex. There are so many options available as best practics that you can go. making the choices you really need, yeah that's the hard one.


I really do think React itself is complex, and its complexity keeps growing. There is a very simple subset, for sure, but all of these are challenging for mere mortals, either to learn or to use effectively:

- Hook rules in general

- Hook semantics for basically everything except useState

- Suspense

- Portals

- Server Components (I know it’s still considered “experimental”, but it’s already in use by large projects/meta-frameworks)

- Even the “new JSX transform” has a couple footguns

Of course you don’t have to use any of those, but for most real world front end projects that would likely mean reaching for ecosystem tools which, as you said, come with their own complexity and choice on a paralyzing scale.




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

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

Search: