The popularity of React JS is exploding. Let’s take a look at the main features and benefits of this new kind of web rendering engine.
React offers a best of breed logic
To manage the application structure of a website under React, Facebook has developed Flux. A design pattern that does not impose a reference implementation. “There are several implementations of Flux. Redux is the one that tends to impose itself, especially because of the simplicity it allows in terms of coding,” continues Nicolas Cuillery. Proof that Redux is becoming more popular: its creator, Dan Abramov, has been hired by Facebook (see his presentation on Youtube about the advantages of Redux at React-Europe). In terms of routing, React Router is also beginning to emerge as a de facto standard for building React applications, even if, here again, there are other solutions. Finally, on the AJAX side, there is no specific brick in the React ecosystem, so why not turn to the Fetch API.
A very flexible architecture
In terms of performance, React optimizes operations on the DOM by using a virtual DOM. Concretely, this device compares the existing DOM to the one whose display is requested (returned by the .render() method), then via a reconciliation mechanism modifies only the part of the virtual DOM that needs to be modified. In the end, only the elements impacted by a change in the web page are updated.
Another particularity, React is component-oriented. This makes it suitable for the creation of modular architectures, or even microservices oriented (although its components can not be contained). “It is also possible to optimize the display performance component by component,” adds Nicolas Cuillery.
React is not yet in stable version
Important point, React is not yet in stable version. This can, in some cases, lead to painful version upgrades. In its latest beta (0.15), React is evolving with a view to eventually open up to the management of other rendering technologies than the DOM.
“Thanks to its openness to other rendering modes, React should evolve towards the notion of React Core, which would make it possible to address several categories of React Native-type views[the declination of React for native apps NDLR] or React DOM. It’s a vision that is part of the project’s roadmap,” explains Nicolas Cuillery.