React Js
React Js
ReactJs is open source front-end developer JavaScript library building user interface based on UI Components. It is maintained by Meta and a community of individual developer companies. ReactJs discovered by Jordan Walke in 2011.
Some practical example on React Js
Lets say one of your friends posted a photograph on a Instagram. Now you go to like the image and then you started checking out the comments too. Now while you are browsing over comments you see that the like count has increased by 100 , since you liked the picture , even without reloading the page. This magical count change is because of ReactJs.
React is declarative , efficient and flexible JavaScript library for building user interface. 'V' denotes the view in MVC, React Uses a declarative paradigm that makes it easier to reason about your application and aims to be both efficient and flexible. It design simple views for each state in your application , and ReactJS will efficiently update and render just the right component when your data changes. The declarative view makes your code more predictable and easier to debug.
A React application is made of multiple components , each responsible for rendering a small , reusable piece of HTML. Components can be nested within other components to allow complex applications to be built out of the simple building blocks. A components may also maintain an internal state -for example , a TabList components may store a variable corresponding to the currently open Tab..
Note: React is not framework. It is just a library developed by Facebook to solve some problems that we were facing earlier.
How does it Work:
While building client -side apps , a team of Facebook developers realized that the DOM is slow (Document object Model) is an application programming interface (API) for HTML and XML documents. It defines the logical structure of documents and the way a documents is accessed and manipulated). So , to make it faster , React implements a virtual DOM that is basically a DOM tree representation in JavaScript. So when it needs to read or write DOM , it will use the virtual representation of it. Then the virtual DOM will try to find the most efficient way to update the browser 's DOM. Unlike browser DOM elements , React elements are plain objects and are cheap to create. React DOM takes care of updating the DOM to match the React elements .The reason for this is that JavaScript is very fast and it's worth keeping a DOM tree in it to spend up its manipulation.
Comments
Post a Comment