Whatever one feels today about React, there is no doubt that it has given functional and declarative programming an important light.
Not in the sense that React itself is functional or declarative (it isn't albeit its roots are in Ocaml), but the style of programming it introduced to many millions of web developers made a sizeable chunk of them interested in fp and many of those percolated to strictly typed FP in TS, Elm or Haskell.
Pretty much every major fp language has tried to implement their own declarative UI after React's success, be it for terminal applications or native development.
I think these two are React's biggest lasting contributions. Describing UI in a declarative way, and introducing many functional programming concepts to the world's JS devs.
I myself fell in love with functional programming in part because of many of the concepts I was introduced to by the likes of Dan Abramov and company.
It led me down paths of research I wouldn't have known to go down, all the way back to the dawn of computer programming.
> React's biggest lasting contributions. Describing UI in a declarative way
I feel that AngularJS (v1) did that years before React, and maybe even other MVC frameworks before that.
I can't think of anything React brought in that earlier frameworks didn't already have in a form or another. Maybe hooks? Arguably the worst and least performant part of React.
It only popularized "HTML-in-JS" but that has always been possible via strings or file imports. Even template pre-compilation was part of Backbone or Ember (I don't remember which)
> I feel that AngularJS (v1) did that years before React, and maybe even other MVC frameworks before that.
Angular markup lives in templates which are used to generate and update the UI, while React markup lives in expressions which evaluate to values. This is a subtle but key difference. I would argue React isn't even an MVC framework (though it sorta pretended to be one for a while)
> I can't think of anything React brought in that earlier frameworks didn't already have in a form or another. Maybe hooks? Arguably the worst and least performant part of React.
The virtual DOM existed only in a library or two that you had to build around, before React made it into a useable framework. The whole "automatically figure out minimal DOM changes", especially things like reusing existing <input> elements so the user input doesn't vanish or the element lose focus, were pretty much brand-new when it came out.
> but the style of programming it introduced to many millions of web developers made a sizeable chunk of them interested in fp
Why would that be? React is not functional, and the style of programming has nothing to do with functional programming. It is fundamentally inconsistent with functional programming.
> Not in the sense that React itself is functional or declarative (it isn't albeit its roots are in Ocaml)
At the beginning of React there were two different components: class-based and pure functional components. Pure functional components rendering has always depended _uniquely_ on its props. No surprises. This introduced a very large number of developers to indeed a declarative/functional style of programming which only depended on the inputs in an era when components were written with local state. Several libraries like Redux, which was Elm-inspired, further introduced millions of developers of combining a declarative/functional/reactive paradigm with handling state without mutations but messages.
Context, then hooks and other features broke this paradigm, whatever is the final result does not depend anymore uniquely on the inputs. React team believes the net result is positive.
I myself with others who commented in this thread and plenty of people I know where introduced to this style of programming with React and then migrated to more strict libraries in the TypeScript ecosystem or other languages such as PureScript, Scala, Elm, Haskell, etc.
Indeed. I would add as well that React (for me at least) went a long way towards erasing the difference between "backend" and "frontend" development. When I was a pup, they were very different things and a "frontend" developer meant basically someone who was really good at CSS and HTML and new all the magic incantations you had to do to create a nice UI with them. There were of course precursors such as AngularJS (and others) but React was really the first one for me where I could see frontend dev as just learning another framework the same as I would learn a backend framework.
Not in the sense that React itself is functional or declarative (it isn't albeit its roots are in Ocaml), but the style of programming it introduced to many millions of web developers made a sizeable chunk of them interested in fp and many of those percolated to strictly typed FP in TS, Elm or Haskell.
Pretty much every major fp language has tried to implement their own declarative UI after React's success, be it for terminal applications or native development.