6 ms·
React hooks is influenced by Dan, the author of Redux, not a fan of them both
by taooftea 6y ago
React hooks is influenced by Dan, the author of Redux, not a fan of them both
- rat9988 6y agoI'm pretty sure hooks weren't his idea. Can't remember where he said that. The fact that he enjoys communicating doesn't mean he is the only one working on react.
- danabramov 6y agoI documented it here. :-) Sebastian Markbage came up with them, with different inspiration sources. https://reactjs.org/docs/hooks-faq.html#what-is-the-prior-art-for-hooks https://reactjs.org/docs/hooks-faq.html#what-is-the-prior-ar...
- msikora 6y agoIMO Hooks is the best thing that happened to React. Once you get used to it it is a lot more clean and productive. It requires you to unlearn a few things though, e.g. don't think about component lifecycles, but think about data flow/changes. Once you get used to it is a lot more productive and enjoyable way of developing React apps.
- mybestguess 6y agoI believe it would have been better to have Hooks as a separate library, not part of React. For the developer it is just another design pattern, not really an improvement, especially if you look at all the edge cases and issues you'll find around. Personally I don't like the design pattern, a matter of taste. But it's very annoying now in the market to have mixed React and Hooks codebases, with all their issues..
- taooftea 6y agoNo, it's just another hype.
- danabramov 6y agoDan here — I don't quite know what you mean by this, but if you're interested in the actual inspiration behind Hooks, you can check out our Prior Art section: https://reactjs.org/docs/hooks-faq.html#what-is-the-prior-art-for-hooks https://reactjs.org/docs/hooks-faq.html#what-is-the-prior-ar.... I only worked on documentation and presentation.
- taooftea 6y agoI mean you don't write good library. They are both hard to use.
- spanhandler 6y agoI think React hooks are silly but Redux is an OK solution to a certain problem, and one of the nicer major libraries in all of JavaScript land, wildly better than almost anything else of similar prominence (it's fairly small and IIRC it has one dependency, with one other transitive dependency, and that's it). I don't see the philosophical or practical connection between the two.
- acemarke 6y ago`redux@^4` currently has two dependencies: `symbol-observable` for compat with observable libs, and `loose-envify` for compat with Browserify. I plan on removing both of those when we release Redux v5. Our official Redux Toolkit package [0], which is now our recommended approach for writing Redux logic, _does_ have a few more deps: Immer, Reselect, Redux-Thunk, and the Redux core. But, those are all things you probably would have had in your app anyway. If you're not familiar with Redux Toolkit, it includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once. I just published a brand-new "Redux Essentials" core docs tutorial [1], which teaches beginners "how to use Redux, the right way", using our latest recommended tools and practices. I'd encourage folks to check it out. [0] https://redux-toolkit.js.org https://redux-toolkit.js.org [1] https://redux.js.org/tutorials/essentials/part-1-overview-concepts https://redux.js.org/tutorials/essentials/part-1-overview-co...
- spanhandler 6y agoThanks for your work on it. I've found Redux super-helpful and pleasant to use for multi-platform JS UI work, in particular, to bundle HTTP client (and other network services, if not in the browser) libs behind a common, small, well-understood-by-React-devs state interface. I'm a huge fan of dependencies I can abuse—fake-up in an afternoon on unsupported platforms in another language, rip out of one place and cram in another without a fuss, stuff like that. Redux is one of the rare deps in JavaScript I never feel queazy about including in a build. I'm too out-of-the-loop these days to know what Immer is, will have to give it a look.
- vga805 6y agoHow about you don't make it personal, and limit whatever criticism you have to technology. And why not include actual criticism, rather than just stating that you personally are not a fan. Thanks for the pointless comment otherwise.