Why React was created
The common way of building UI is to first render your template, then wire up events between your model and the DOM so when a particular property on your model changes, you can get a specific piece of the DOM and update some property on it or its contents. For small projects this approach is really nice, and you will hardly find any performance issue. But in case of big projects it’s a performance penalty to do this sort of thing lots of times in a single frame of execution since querying and updating the DOM are pretty expensive operations. It also tends to produce tons of boilerplate code. This was the cause behind the birth of React.
How is it different?
React is not a MVC framework:
React has been developed to build component based user interfaces. It encourages the creation of reusable UI components which present data those changes over time.
React doesn’t use templates:
Traditionally, web application UIs are built using templates or HTML directives. These templates dictate the full set of abstractions that you are allowed to use to build your UI. React approaches building user interfaces differently by breaking them into components. This means React uses a real, full featured programming language to render views, which means good efficiency.
Reactive updates are dead:
Why to use React?
It doesn’t do much complex works so the implementation is also very simple. Simply tell it, how your app should look at any given point of time, and react will take care of all data changes.
Like any other data binding featured framework react also updates the data in your templates. But the difference is, it knows where exactly the changes need to be done and make the cost minimal.
Dynamic UI and Interactivity:
It makes your UI very lively with data binding, smart event handling and delegation.
Multiple and Reusable Components:
React has the concept of nested component where you can use the components as parent child relation. Reusability is something which always makes a project well structured.
React is not developed to do many things. It’s really short and simple with some limited but perfect features. Its data binding concept is really a mature one; and so is reusable component. If your project is just related to rich UI, then there is no need to go with heavy frameworks like Ember Angular Backbone etc; when you have a real light and mature one like React.
Still having issues?
If you still have issues understanding the above article, please leave a comment below and we will try to address that. In case you need help in your projects or understanding anything related to Programming; contact me, Paul Shan for assistance. Thank you for being a reader of VoidCanvas.