Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If react, and specifically react using functional components, is going to be a full featured web framework, hooks or something like them are necessary to integrate with the browser and the web of 2023.

The 101 parts of functional programming are a very easy pitch. Stateless behavior, testable functions, no surprising side effects from way down the tree. When it gets to 201 stuff - boxing (like useRef) and dispatch (like useState) complexity creeps back in. That complexity is necessary, however, because that's the stuff people actually want to do.

Hooks let react interact with browser audio and video, mapping tools, and other things that are reasons why people want to use web pages. They're complex, but there are limits to how simple a bridge between a functional programming framework and a mostly stateful host system can be.



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

Search: