DEV Community

Joan Perals
Joan Perals

Posted on

Why are you using React?

React is the most used library for frontend development these days, and I would like to better understand why that is. So if you use, have used or are planning to use React, I am curious to read from you what were/are the reasons to adopt it, for example:

  • Do you find it better than others, and if so for what reason(s)?
  • Because it is the most used?
  • Others chose it for you?
  • Compatibility with other tools?
  • You didn't stop to think about alternatives?
  • Other reasons?

Discussion (5)

Collapse
dasdaniel profile image
Daniel P πŸ‡¨πŸ‡¦ • Edited on

React is a mature library with lots of resources. The React team and community has some very smart folks working on it. The library itself, the features and the extended react libraries have paved way for other frameworks. They are continuing to innovate and I admire the adherence to solid programming principles. That said, I mostly work with Vue, and given the opportunity, would like to work more with Svelte.

Collapse
jperals profile image
Joan Perals Author

Thanks for your detailed answer! So if you have to choose a tool for a project, which one of those (React, Svelte or Vue) would you use? Or it depends? Would it be the same for a side project as for work?

Collapse
dasdaniel profile image
Daniel P πŸ‡¨πŸ‡¦

For work I usually reach for Vue. I feel most comfortable getting something into production with Vue, but largely because I use it most often, so that's like a self-fulfilling reasoning.
The reason I prefer it is that it is the fastest to learn, which is helpful when you're working with a team that desn't usually work with js too often. Once you figure out a couple of gotchas (essentially reading the reactivity in depth document) you're ready to contribute. I think the learning curve is quite a bit steeper for react. The react hooks have become quite popular, but I think they make learning react a bit harder. The class based lifecycle hooks were more self explanatory than using useEffect to do three lifecycle evenets. Also getting simple input binding to work requires a lot less boilerplate. I think if I was working with a team that has a strong front-end core competency, I'd advocate for React more.
I think Svelte could use a bit more "maturing" before I start using it as readily as Vue. For example, the svelte extension for VS-code was miss-behaving, so I ended up disabling it and now my IDE marks my code as having errors. I was also had some compatibility issues with two compiled components conflicting on globally declared functions. Also there isn't anything like the Vue or React dev tools (because it works a little different) so debugging issues is not as easy. I think over time these things will improve.

Collapse
mikayel profile image
Mikayel

Virtual DOM philosophy
Composition Pattern

Collapse
jperals profile image
Joan Perals Author

What do you like especially, or find most useful, from React's approach to composition? Or, how do you usually do composition with React?