2 ms·
I suggest you to read about algebraic effects. We don't have them in JavaScript, but conceptually that's what Hooks represent. (This is as functional as it gets
by danabramov 8y ago
I suggest you to read about algebraic effects. We don't have them in JavaScript, but conceptually that's what Hooks represent. (This is as functional as it gets.)
React has always been about taking useful ideas from functional programming and bringing it to mainstream through pragmatic choices in JS.
Your concern about the "globalness" is addressed in Sebastian's comment which is linked five times throughout the post — you should definitely check it out! https://github.com/reactjs/rfcs/pull/68#issuecomment-439314884 https://github.com/reactjs/rfcs/pull/68#issuecomment-4393148...
Finally, don't forget you're comparing Hooks to classes. Those are hardly functional either.