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

You really don't need to give hooks access to some global variables (or all of them). You can, of course. But you would actually do that in a useEffect or use some setState in a callback somewhere.

It's a cheap shot to complain that Javascript isn't a purely functional language... React can be used in a pretty pure way and if you don't you'll don't get the full benefit.



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

Search: