React Web framework Introduction


React is a web framework which is developed and maintained by Facebook and Instagram. React is a Java Script library used for creating composable user interfaces. React facilitates creation of reusable User Interface components to show data that change along with the time. React serves like the view of Model-View-Controller (MVC) architecture. Therefore most of people tend to use React. React is capable of abstracting the Document Object Model (DOM) from your application and provides a simple programming model to your application with better performance. React is mainly useful for web applications which deal with large amount of data that change with time without reloading the entire application. React render on the server by using Node. It aids for native/mobile applications by using React Native and React VR used to develop VR applications. React is developed focusing on Speed, Simplicity and Scalability. React has a component based life cycle for the development process. React components are extended from React. Parent class component inherits methods that belong to React life cycle. React JS constructor declares state and connect the respective context to life cycle events. Constructor does not call setState but calls super(props) to connect to the props.  Props and states are some key important words in the react web framework. Props send data and methods from container components to its child components and they are at the read only state. State keeps data which can be updated and state is at the read state and it is enabling for editing. In react we have setState() method to update the state and if we want to use state and props inside setStatemethod, then we can set it as setState((state.props)=>{}) To create a React application, technologies like Node, NPM, MongoDB, React JS, and Express JS are basically required.

Let’s look into the features.

JSX
React JS language is a JavaScript syntax extension which is used to define user interfaces. The syntax is very much similar to HTML. JSX converts expressions to strings so that it prevents cross-site scripting attacks. It is not compulsory to have JSX in React development environment but it is recommended.

Unidirectional data flow
Data is kept at one place and flows from the parent component to its child components. The actions flow from child component to parent component which makes it easy to analyze the application. When a change is done to the application, it only renders the change that it has made.

Components
React runs on components which help to maintain the code when working on large-scale projects.

Virtual Document Object Model (DOM)
React has a virtual DOM tree which compare with the rendered tree and update only what is changed. This is used instead of DOM manipulation.


Advantages
· React uses virtual DOM which is faster than the regular DOM so that it enhances the performance.
·React can be used on the client side and the server side as well as with other frameworks.
· React has high code readability due to component and data patterns which is more suitable for maintaining large applications.

Limitations
· React needs to integrate with other technologies to have a complete tooling set for software development.
·Developers may face difficulties when using React because of inline templates and JSX.




Comments

Post a Comment

Popular posts from this blog

JAVA OOP Concepts

Solid Principles in Java

OOP Design Patterns