DEV Community

Nick Lewis
Nick Lewis

Posted on

Why do you use React?

What makes it so good?

Why do you use it over other build tools?

What is the learning curve like? Any suggestions on resources?

Top comments (6)

Collapse
 
adrianbdesigns profile image
Adrian Bece

I love working with React. The reason is simple: it allows me to easily create whatever I like. It's powerful, extensible, and I can create simple apps really fast. I can easily connect to any API and play around with data or I can set up my own Firebase instance and play around. I can easily add delightful animations and micro-interactions.

Why use it over other build tools? No particular reason. You need to have a tool for every job. And I found React to be a great tool for a lot of the jobs. I simply learned to work with React first, I loved it and I keep going in order to master it. I never had the need to consider other tool or compare it to other tools. It's enough for whatever I'm doing.

The best way of learning it? Complete a simple free tutorial and find yourself a good personal project to work and experiment on. Maybe connect to an API and see what you can do with data.

For example, my music collection site was my first project and I've learned a lot while working on it: adrians-music-collection.netlify.com/

Collapse
 
nickylewlew profile image
Nick Lewis

This is super! Thank you.

It's definitely something I want to look into, just not quite sure where to start! I shall try and find a good free tutorial and give it a shot.

👍

Collapse
 
bartmr profile image
Bartmr • Edited

I use React because:

  • I can lazy-load components and services based on where they are in the navigation. I can just have a huge navigation tree with dozens of nested pages, and just cut a branch and say "this branch of the navigation will only be loaded if I need it". In Angular I have to create NgModules and move files and have dependencies load in a main module which might not be present in other stuff or whatever.
  • Hot-reload (saving a file, the code gets updated and changes appear on the screen without having to refresh the page) works like a charm
  • Can reuse mobile components in web pages.
  • Data can (or should) only go one way
  • Higher Order components
  • No inheritance. Only composition
  • React Context lets me detect the background color of a parent component, allowing me to change text color on runtime if it doesn't have enough contrast. Really useful for dark theme switch while using an app or website.
  • Debugging errors in components is super easy. Because React is just a thin View layer
Collapse
 
nickylewlew profile image
Nick Lewis

Awesome, thanks for this!

There are certainly some nice aspects about it that you're describing.

What would you say the learning curve is like for someone who hasn't worked with a component tool like React before?

Do you have any helpful resources for learning?

Collapse
 
bartmr profile image
Bartmr • Edited

You can do stuff pretty quickly in React and Redux in now time. More faster than Angular because Angular is split in several modules and its own workflow. React can be used however you like it. You can even have normal HTML pages with sections made in React. The thing is, with experience, you will always find better ways to do stuff. The first one will problably be "Holy sh**, if I had made my app in way A instead of way B, changing to server side rendering would be a single line of code".
It's been two years since I started developing apps and webpages with React from scratch, and I always find new ways to make better and more easily editable code. Starting with React is easy. Being a pro and doing changes like it's a photoshop document, that's the hard part. To summarize my opinion, here's a meme.

Meme

Collapse
 
nickylewlew profile image
Nick Lewis

I genuinely want to know why everyone is loving React. I don't know quite enough about it really. So, I'm asking this so I can make the decision or not in spending the time and money to learn it.