Introduction to React JS
What is React JS?
React JS is a JavaScript library that we can use in web development to build interactive elements on websites.
What is the use of React JS?
When React uses a JavaScript library, it helps developers who build user interfaces or UIs. Websites and web applications are collections of UIs on-screen buttons, menus, search bars, and many other things that interact to USE a website or app.
Remember React JS is used in front-end development. You can memorize it by, "the on-screen" elements of UIs - React is used definitely for "client-side" programming and because of that, it makes a front-end library.
Developers were stuck building UIs with the "vanilla javaScript" or they use less focused UI like JQuaray when they before getting into use in React JS. Because of that, it cost a longer development time with a lot of opportunities for errors and bugs. So, to overcome this problem in 2011, Facebook engineer Jordan Walke created React JS especially to evolve the UI development.
React library code provides additional reusability to save development time and reduce the possibility that code getting errors and it comes with main two key features and those are JSX and Virtual DOM.
What is JSX?
Every wedsite builds basically with HTML documents and web browsers read those documents and display them on whatever device you may have, like the computer, laptop, tablet, or in your phone as the web page. While this process happening, in the browser there is something creating called Documents Object Model(DOM), that represent how should be the web pages are arranged. So, developers can modify these DOM with languages like JavaScript and add dynamic content to their websites.
React extension called JSX(JavaScript eXtention) can use to modify the DOM using simple, HTML code and JSX help web developers to do it in an easy way. React JS supports all modern web browsers and JSX also well matches any browser platform that you work with.
After using JSX to modify the DOM, leads to remarkable site improvements in performance and develops productivity.
What is Virtual DOM?
VDOM or virtual DOM is a programming concept with a perfect or virtual representation of a UI kept in memory. In React, every Virtual DOM is corresponding with a DOM object. DOM object like a lightweight copy represents the virtual DOM object.
A virtual DOM object contains the same properties as a real DOM object, but it has a lack of real things that power to directly, can change the content on the screen.
Manipulating the virtual DOM is much faster than manipulating the DOM. Because of the drawn onscreen. Manipulating the virtual DOM is like editing a blueprint, as moving against in actual house rooms.
Comments
Post a Comment