I've been using React for a long time. Here's my React story:
I've had an up-and-down relationship with React for a few years, but now I like it and use it for nearly all my front-end development.
I was developing an open source web app that was bi-lingual, so at the click of a button the whole site would instantly switch between English and Spanish.
The old way of doing this was to define a Context at the top level so that changes could apply to the whole app, not just to individual components and children. Passing changes to children wasn't working reliably anyhow. Then, two things happened: Context was deprecated, and JavaScript classes were introduced. Both seemed like bad ideas (and were later rescinded.)
I ported my app to the Surplus framework, which is a React work-alike with JSX and worked well. Here is the documentation I wrote for the project. Surplus has great benchmarks, but is mostly a one-person project and never seemed to get the popularity it deserved. I was concerned about its future. I then ported it to Inferno, which is a fork of React that used functions instead of classes for components, and played with other frameworks including some of my own.
Then in September 2018 I saw Dan Abramov introduce Hooks at the annual React conference. He described all of the problems that had driven me away from React in the first place, and how they had been addressed. I was surprised, and felt like my concerns had been noticed by others too. Around the same time "create-react-app" came out, which generates most of the boilerplate needed for an app, including code splitting and tree shaking to eliminate dead code. Plus, no more hand-fiddling with Babel and Webpack. So I'm back.
There are many other JavaScript frameworks that compete with React. Some thoughts:
- Angular I used Angular 1 for a web app, and thought it was pretty good. That all changed when Angular 2 came out, which used a completely different architecture with features I didn't care for, like classes and decorators. Angular takes an approach that appeals more to HTML developers, where React is more for those comfortable with JavaScript. I'm one of the latter.
- Elm Elm is inspired by Haskell, which is a pure functional language. Elm's author wrote his doctoral thesis on Haskell as a language for web browsers, and some problems caused by lazy evaluation for example. Elm is pretty much the result of the thesis.
- Purescript Purescript is as close to Haskell as possible, and transpiles into JavaScript. When I first encountered it a couple of years ago, it was experimental and not ready for production. Now things are different, and Purescript has a growing community and good support.
- Vue I haven't had much experience with Vue. It seems to appeal more to developers without much JavaScript background, and is easy to use, but not as flexible as React.
- Meteor Meteor is more of a full-stack framework, and has a separate front-end framework called Blaze.js. It has a lot of functionality built in, and is integrated as a Node server side platform. Unfortunately much of the included functionality is out of date, such as Node versions. Also, it can only use MongoDB as a database, so relational DBs are out.
I see two problems with Elm. First, the interpreter has to be loaded into the browser, so that the language can be transpiled into JavaScript. This causes initial loading to be slow. Second, even though Elm is written in Haskell, the author chose a different syntax that seems arbitrary. Better if he stayed with Haskell-like syntax where possible. Elm is used by only one commercial company that I know of, which hired the author for support.
If you use React for your projects, or are thinking about it, let me know. I'd like to help you.