What I love about React JS after using it for years

React JS was released on May 29, 2013, and since has become a popular front-end framework for developing web-based applications. I have been using it for years now and have grown to enjoy it.

I remember my initial thoughts on React JS in regards to the syntax. It was weird. It was HTMLish and it was inside javascript code! Very weird! Everything I had learned about coding told me that was a no-no, separation of concerns, and all that. In the end, we decided to try it and from then on I have been using it ever since.

Easy to write

After getting past the syntax, it is easy to get coding. You can use javascript functions to generate react code, for example, generating a list in react can be done with Javascript’s map function

class TodoList extends React.Component {
  render() {
    return (
      <ul>
        {this.props.items.map(item => (
          <li key={item.id}>{item.text}</li>
        ))}
      </ul>
    );
  }
}

The hard part about frameworks like Vue and Angular is learning all attributes that match the use case. For example in Vue.js

<ul id="array-rendering">
  <li v-for="item in items">
    {{ item.message }}
  </li>
</ul>

You need to know to use the v-for attribute.

Support

Facebook

When evaluating if you should use a framework, you should look at the support. The last thing you want to do is have to fork it yourself to fix issues or put in pull requests only to have them merged in weeks later.

React is heavily supported by Facebook. Their commitment comes from them using React in their own production websites. The top contributors are full-time Facebook employees.

Large community support

There is extensive base user support. A lot of large companies are using it. Viewing it on Stackshare you may just recognize a couple of the companies.

Npm shows impressive weekly downloads.

React has good performance

Most frameworks would update the DOM directly. React took a different approach by creating a Virtual DOM. With this approach, they can determine when the state has changed and update the DOM in the least expensive way.

The Virtual DOM can sound daunting but is all abstracted away from the developer. It is handled behind the scenes and is done so well.

NOTE: Just because you are using a virtual DOM does not mean your page will have good performance if it is doing a lot of things at once. It will still be forced to update the DOM.

Similar Posts