When React Hooks come out of alpha, the render props pattern will be rendered unto the dustbin of history.

When React Hooks come out of alpha, the render props pattern will be rendered unto the dustbin of history. https://blog.logrocket.com/react-custom-hooks-and-the-death-of-render-props-a0ce5cba387f

10 thoughts on “When React Hooks come out of alpha, the render props pattern will be rendered unto the dustbin of history.

  1. And then keep in mind that it’s all about to change and OO components will get thrown out in favour of just functions and hooks in a few months time. This will be a dramatic simplification.

    Like

  2. Emlyn O’Regan there are two tendencies. One is due to migration of developers from other languages wanting their OO garbage. Alas that group also happens to own the chrome browser so you see it setting standards such as web components and the garbage they are currently adding to the class spec (private methods, static methods etc). The other tendency, which strong in the React, world is the influence of real functional programming, eg Haskell, OCaml etc which favour first class functions of over everything else. They only use objects because of polymorphism because JavaScript lacks algebraic types (more powerful than Java style types).

    Facebook despite being the world’s most evil corp has some really great engineers who unlike Google are not all frustrated Java jocks. They are even developing a true functional language called Reason which is actually just a JavaScript style syntax over OCaml.

    React which is the clear winner of the frameworks war (due to the incredible smartness of this group) is all about functional composition except in cases where components are needed to be stateful and have lifecycle hooks. This was always the contradiction at the heart of React which becomes complex once you start doing harder stuff which relies on OO. Hooks means you never need to use classes or spread your code all over the place like you do with OO. It’s a big simplification.

    The other thing that’s unique about the react world is it’s resistance to Typescript. That battle they are slowly losing though. Typescript for good or ill is taking over everywhere.

    Like

  3. I really like React and using it will teach you new things about programming and expose you to new ideas (some of which turn out to be very old academic ideas). No other framework will do that. Frameworks are usually about not learning anything new. That’s kind of their point.

    One thing about React though is that its a universe unto itself and therefore you need to be aware of and not fall for some of its ideology. Number One is that that the web as a platform is badly designed for apps and that you need to abstract it all away and rewrite all of its features in JavaScript. It is very programming focused and this means that react projects do not work well with conventional web development. Everyone on the team has to become a programmer. This tends to leave CSS designers and accessibility experts a little on the outer. It means wheels need to be reinvented because programmers want to program and that often means refusing to learn the perfectly good declarative interface that already exists.

    The attitude of react types to emerging standards such as web components is very instructive. The point is that react has won but this victory has spurred interest in the browser platform and standards as the only counter tendency. Keep both in mind when going forward. Web components mean that you often don’t even need a framework, that the modern browser platform is already powerful enough if you learn how to use it. Watch this space.

    Like

  4. Emlyn O’Regan yes it’s just engineers being engineers. Most don’t see that OO as defined in the 1980s is mostly bad. Alan Kay is particularly scathing about what people now refer to as “object orientation” as exemplified by C++ and Java. Smalltalk would be better understood these days as a message passing architecture, actor model.

    Like

Leave a reply to John Hardy Cancel reply