Why Rails developers should learn React
Rails developers should learn React because there’s growing market demand for developers who know both. Learning to use React will make you more money and a better developer.
In many ways, React is to the modern frontend, as Rails is to the backend — there are many alternatives, but React has the best combination of simplicity, power and community momentum to make it a great choice.
Web UIs have matured a lot over the last decade. We’re doing more complex things to build better user-experiences on the web. jQuery has served us well, but even a medium-sized project can now quickly turn into the Flying Spaghetti Monster.
The truth is that React has been out for more than three years now and it looks like it’s here to stay.
It may be tempting to just stick to jQuery and ignore React because it looks alien and intimidating (Babel, Webpack, ES6, Redux, Flux, MobX, transpiler, transmogrifier…you may ask yourself “why do I need all this?”).
But you’ll do well to pay attention to the changing market and make sure your skills match what employers and clients are looking for in 2017.
Increasing market demand
There’s a huge and growing market demand for React developers. Many companies are moving their frontend away from plain Rails templates and jQuery over to React, so learning React would give you a unique advantage over others vying for the same jobs.
Every other job post on Hacker News mentions it.
Even if React itself is replaced by something else, the concept of reactive UI — UI as functional components is here to stay. So it’ll help you a great deal to learn to use it. Coming from an imperative background, React’s declarative approach will make you see software in a different light and make you a better developer.
It’s also your chance to get into mobile development
Once you learn to use React with Rails, you can also use React Native to build mobile apps for the same API. This way, your investment in learning React gives you the chance to easily build cross-platform apps.
It’s early days yet, but React Native looks very promising in terms of code re-use and performance. For example, Facebook Ads Manager shares 85–90% of code between its iOS and Android apps and were built by a single team.
If you have been meaning to try your hand at making an iOS or Android app, but just haven’t got around to it, React could be your gateway to building mobile apps. This is yet another way to increase your market value.
But isn’t it overkill?
You’re probably wondering…isn’t React overkill for small projects? It probably is — I am not convinced one way or the other, yet.
When you’re working in a team you don’t often have the luxury of rewriting the whole app. You’re often stuck with your initial choice. Since many people are finding React superior at least for medium to large projects, you might want to consider using it right from the start of a project if you expect it to grow into more than a small side project.
As the tooling around React improves (see Create React App), the initial hurdles to getting productive with React will also disappear (as they did with Rails).
How to get started
Ok, so you’re convinced you should learn React, but where to start?
First, check out the official React tutorial. You can familiarise yourself with the basics quite quickly.
There are many pros and cons and different configurations for using these gems.
There are also other ways to use React with Rails, as outlined in this accompanying blog post.
Here’s a few other tutorials, tools and resources worth checking out:
- 27 project ideas for learning to use React with Ruby on Rails
- 3 ways to integrate Ruby on Rails + React + Flux
- A Rails, React, Relay and GraphQL Tutorial and Demo App
- The React on Rails Doctrine
For a quick and easy start, check out my new course on using React with Rails. It’ll help you become a PRO at using React with Rails using hands-on video and text lessons. You can check out more details of the course here and sign up today.