Thoughts

Should you... React?

8 years ago
3 min read

I've been reading stuff on the internet for a while; I've read why I should use React no matter what, and why it's so amazing it will blow your mind away. But you know what? Stop choosing React for the sake of choosing React.

Moreover, let's not forget that React is simply a view/component library. Not a framework, but simply a library to create user interfaces, hence why most of the people out there don't use "vanilla React" but have to choose their companion, which is usually Redux or Flux.

While working at DigitasLBi I've been following my team while building a webapp with React+Redux, and I've partially shared the pain of it. I simply don't get a hundreds lines of boilerplate between actions, reducers, and whatever entity out there you need to define to do simple things.

Do you know how many lines would have taken me to run the same with plain JS, or either any other library out there? I'm bet at least half of them.

Don't get me wrong, there's nothing wrong with the design pattern that those libraries are following. What I'd like you to consider is whether they are the right tool for the job, or you are just using them (especially React) for the sake of using it. As the cool kids do, based on the fact that it's a bubble with many stars on GitHub and has been made by Facebook.

Don't be a sheep — and always do some analysis over what you are going to build and choose whatever framework and library you feel confident to go with — and obviously will give you benefits from using it on such project.

We are lucky enough that there's plenty of choice out there; developers, start-ups and big companies have chosen Backbone, Angular, Ember, React (and the list goes on) for their projects and most of the time there has been a reason for using them.

So, "what's the future of JavaScript?", you're asking me.

I don't know, and I can't wait to see it! ES6 has already brought some fresh air and new wings to our favourite language, so why not becoming extremely proficient with it instead of chatting aroud Redux?

By the way, if you haven't tried it yet, Meteor is another great example of framework to use for your next webapp. I wouldn't use it for any project though, so be smart, and make sure you think twice before choosing (or not chooosing) the stack of your next amazing project. The choice is just yours.