React Important Features
Some of the features of React are:
- One way Data Binding
- Virtual DOM
1 2 3 4 5 6 7 var listItem = ( <div border='2'> <div className="col-8" >Hello React!!!</div> <input type="button" className="col-1 btn bg-info mx-1 text-light" value="Edit"/> <input type="button" className="col-1 btn bg-danger text-light" value="Delete"/> </div> );
1 const Welcome = () => <h1> Welcome to React Features </h1>; // Welcome to React Features
This component can be called in a index.html file within script tag as:
1 ReactDOM.render(<Welcome />, document.getElementById('root'));
One way Data binding
ReactJS is outlined in such a way that it takes unidirectional information stream or one-way information binding. The advantages of one-way information binding is to give you superior control through the application.
- Efficient diff algorithm
- Batched update operations
- Efficient update of sub tree only
- Uses observable to detect change. Observable helps to find modified components easily.
Whenever setState() method is called, ReactJS creates the whole Virtual DOM from scratch. Creating a whole tree is very fast so it does not affect the performance. At any given time, ReactJS maintains two virtual DOM, one with the updated state Virtual DOM and other with the previous state Virtual DOM.
React has been rapidly growing popularity among developers due to its simplified features like JSX, components, virtual DOM etc. So, with these features react can make any beginner understand the concept and learn it easily.