Unlike Angular (which is a full-fledged framework) React lacks the model and controller layers out of the box and hence doesn’t let us create applications on its own.
Instead we need to add implementations such as Flux and routing to control the application workflow.
Some people may find this cumbersome and that the entry-level has a steeper curve compared to its competitors – but if you ask me its all worth it at the end.
So why would React be the preferred choice for building web applications in 2017?
Let’s take a closer look into 5 key areas.
No mumbo-jumbo special syntax needed. Why is this a good thing?
When I started out using React and asked an experienced friend – what its like once you get through the learning curve and he told me:
“It’s just awesome – coding is alive once again. This means less copy-pasting as a Front-end hacker.” 😀
Well if you agree to that statement leave a comment below! But basically it means that React enforces good coding practices by not allowing lazy coding.
As for the HTML – in React we have no html-files instead we use JSX which can be confusing at first but it’s actually a great thing in my opinion due to its simplicity.
Some people claim it’s violating the design principle of separation of concerns (SOC) – I guess it’s doomed to be an on-going debate for some time – nevertheless I’ve always loved writing html and I fell in love with JSX after 10 minutes. 😀
2. React is fun
I’ve built web applications in various forms ever since I was a kid (over 2 decades) and I have seen various implementations come and go.
Once you’re up to speed and done with all the plumbing (setting up bundlers, linting, testing, servers etc) – it’s FAST and it’s FUN.
Never before have I gone from Idea to Implementation in such timely manner. And every time I finish I get astonished by the results. The possibilities are endless – which is promising for the future.
If you ask me coding in React compares to driving a Ferrari on the highway instead of a shopping cart. Wroooooooooooooom!
3. React is customisable
Another great thing is – it’s so customisable. While React itself is targeting a specific problem and does it really well, Redux and Webpack solves other problems.
If one library exceeds the other – it’s rather easy to make the switch or picking the other for the upcoming project.
It offers freedom, but it comes at the cost of extra time spent designing the structure of an application.
4. Building “real” mobile apps
You build a real mobile app (not just a “web” app) that’s indistinguishable from an app built using Objective-C or Java.
5. React is awesome for SEO
The great thing about React is that it pre-renders using its built-in method renderToString which means it runs on the server and returns the DOM to the browser as a regular web page.