What is React JS?

React JS


  • It is an open-source JavaScript library providing a view for data rendered as HTML.
  • React views are typically rendered using components that contain additional components specified as custom HTML tags.
  • Its just a view library
  • React was partly inspired by XHP which was built by Marcel Laverdet at Facebook in 2009 to componentize Facebook’s UI.




The reason behind to build React.js :

  • React is not a MVC framework :-  React is a library for building composable user interfaces..
  • React doesn’t use templates :- React uses a real, full featured programming    language to render views, which we see as an advantage over templates for a few reasons:
  • JavaScript is a flexible, powerful programming language with the ability to build abstractions. This is incredibly important in large applications.
  • By unifying your markup with its corresponding view logic, React can actually make views easier to extend and maintain.
  • By baking an understanding of markup and content into JavaScript, there’sno manual string concatenation and therefore less surface area for XSS vulnerabilities. JSX, an optional syntax extension, is also created if in case you prefer the readability of HTML to raw JavaScript.

Some Concept Of React.js :

  • React.JS JSX :  React uses JSX for templating instead of regular JavaScript. It is not    necessary to use it, but there are some pros that comes with it.
  • JSX is faster because it performs optimization while compiling code to JavaScript.
  • It is also type-safe and most of the errors can be caught during compilation.
  • JSX makes it easier and faster to write templates if you are familiar with HTML.

React Router :  Its a  complete routing library for React.When you need to route between different parts of your React application, you’ll probably need a router. React Router uses JSX.



React Components API :   Instances of a React Component are created internally in React when rendering. These instances are reused in subsequent renders, and can be accessed in your component methods as .



React.js -Flux :
Flux is programming concept where the data is uni-directional. This data enters the app and flows through it in one direction until it is rendered on screen.

React Webpacks :
when  we need to bundle together and transform (transpile / compile) files into something that the browser can understand. That’s where tools such as Webpack are necessary.


Pros :

  1. You can always tell how your component will render by looking at one source file.
  2. Bundling Javascript and HTML into JSX makes components easily understandable.
  3. You can render React on the server.
Cons :

  1. An event system (other than vanilla DOM events).
  2. Any AJAX capabilities whatsoever.
  3. Any form of a data layer.
  4. Any application framework at all.

Comments

Post a Comment