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

React doesn't have this "pure function" feature what-so-ever. hooks are magic stateful functions, not pure functions. They behave differently the second time called and therefore have all kinds of side-effects and restrictions on when, where, and how they can be used.


Accumulative recursive functions also behave differently the second time they are called...

Hooks are a declarative DSL for accumulator arguments to the recursive function (the component).

If you would rather rewrite the render loop in continuation passing style, and have a 46 line recursive call expression which conditionally changes like 15 immutable parameters to set up the next render iteration for your component, I'd like to see the code when you are done.




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

Search: