The Virtual DOM is an implementation detail, it allows React to re-render quickly, but this initially differentiating feature may turn into a checkmark if/when all frameworks and view layer libraries implement updates in this fashion. It doesn’t make React special in terms of the DOM. But in terms of providing an abstraction for rendering, the Virtual DOM is huge, React Native and using React to render into HTML5 canvas prove this completely.
JSX is simple sugar to allow consumers to write code that looks more like an HTML tag tree than the nested function calls that are output by the compiler. Every
<div> is transformed into
React.createElement('div'). Functional composability is huge in React, refactoring a component into multiple components is usually very straight forward function extraction.
Early warnings are also a pretty big deal when it comes to React. When I use
class= on a React component, console warning messages will be logged asking me if I really meant
className=, and it’s right, I did mean
className because of specific restrictions in React about HTML properties vs attributes.
react-a11y from @ryanflorence provides messages in the same vein as the main React library offering details about accessibility problems with returned spec for the DOM.
React.PropTypes offers development checking around properties passed through components. Warning in development when values passed through components do not match expectations. The checking is intended to be for development only so checking is only informational.
The flexibility of React is understated or not well understood without a good familiarity with React. The interoperability with existing tools is extremely important. React can work with any major library out there, for better or for worse.
- React with jQuery UI
- React with Ember
- React with Backbone
- React with D3
- React with Angular
- React with three.js
- React with Canvas
- React with Native 1
- React with Native 2
The benefits of React are great, it has it’s downsides as many frameworks do. Performance for initial render will never be as good as hand writing DOM manipulation.
React is greater than the sum of it’s parts. It helps to guide you into the pit of success.