React JS is a JavaScript framework with 10 years of maturity and a huge community supporting its growth and development. But you shouldn’t learn it in 2022. Here’s why.
First, a brief primer: React is currently the most popular front-end framework in the industry. It provides concrete APIs, software design patterns and tooling to help you build web applications faster and in a more maintainable way. A huge community of developers is also continually creating tools and components that you can integrate into your own apps or websites, which adds to its popularity and utility.
What Is React JS?
React JS Plusses
You might choose to learn React for many reasons. For one, it has a fast learning curve for new developers. If you’re not an expert web developer, React can be an easy way to introduce yourself to a lot of HTML, CSS and JS concepts all at the same time. You also don’t need to start with the basics if you begin your career using React — you can take features that other developers have built and combine them, often eliminating the need to write features from scratch.
React also teaches implementers some positive development practices. Its nature forces you to isolate UI component functionality and build small pieces of the interface that do only one thing well. Generally speaking, methods that are more loosely coupled (with less external dependencies and with fewer responsibilities) are easier to unit test and easier collaborate on, especially if you’re working on a large application. React also teaches you to think like a functional programmer and even extends functional programming concepts with methods that return HTML instead of JavaScript objects.
Why You Shouldn’t Learn React JS
Despite its plusses, reasons are mounting to not learn React. We’ve arrived at a tipping point where it may not be worth adding this tool to your kit as an engineer.
First and foremost, React keeps developers from learning many of the fundamentals of web development, especially when it comes to separation of concerns and the basics of the core web technologies, HTML, CSS and JS. The React interface abstracts away browser APIs for building websites so that developers who only know how to build in React won’t need to understand them. When a new HTML markup specification reaches full browser support, these developers will be often the last to use it because React applications often don’t play well with browser features. This problem is a huge loss for the development community at large: We’re keeping engineers from becoming real experts in web technologies because they’re too busy learning React specifics.
Secondly, React requires extremely complex build tooling that ultimately reduces code maintainability. To run your React code in production, at least four steps of transpilation need to occur, often leading to complicated configurations that can take years to master. Without diving too deeply into the specifics, React files (typically written with a .jsx extension) cannot be executed directly by a web browser and need to be converted into a file type that is readable, typically javascript files. At the end of all the transpilation, the code that you wrote is unrecognizable from the code that runs, making it much harder to debug.
These complex build processes also make the long-term maintenance of your applications much more difficult. Because of the build tool complexity, your choice of tool can ultimately be as restricting as your choice of front-end framework in terms of maintainability. If your application has a build tool configuration that is outdated, it can be a challenge to find new developers that will be able to maintain it.
Finally, React’s pioneering concept of component-based UI development has been adopted by the development community at large. Now, more and more varied options exist, provided both by competing front-end frameworks and by browsers themselves. React created a paradigm shift in web development, moving developers from thinking about HTML, CSS and JS as separate resources, to thinking in terms of units of functionality or “components” that contain all three and can be shared and reused. This framework is now the de facto mental model for web development, and the space has become saturated with choice.
React’s Days Are Numbered
The signs that React is losing its monopoly on component-based web development are clear. Competing frameworks are now starting to pull ahead in terms of developer satisfaction and searches for React are down over the last year. Finally, web components, the browser’s native API for bundling up HTML, CSS and JS into reusable chunks, are finally being adopted by major browsers and are projected to be one of the most important technologies in the space.
As a front-end developer with years of experience developing React applications, I believe it will have many more years of life as the most popular framework for web developers. Every tool has a lifecycle, though, and React is starting to reach the end of its (extremely influential) life. The concepts that React brought to the world of web development will continue to grow and develop, but if you are not in the world of React development already, I would recommend that you take a step back and reconsider based on the current technology available to you.