what-is-reactjs-programmertoday

What is Reactjs ?

A JavaScript library for building user interfaces. It is a flexible javascript library used to reusable UI components.
Basically react is the view layer and used to make the view for a web application.

It is an open source project created by Facebook.

Main advantage of using react is that it works on virtual DOM unlike the regular DOM which makes the rendering fast.

React also streamlines and simplify how to store data and handle it using state and props.

It lets you create complex UIs by creating small and isolated piece of code called components.

React Components

In React all the functionalities are created in the form of components, they are the building blocks of a react application. These components can be classified into two broadly.

  • Class components
  • Function or Simple components

Class components

It is also known as the stateful component because they can hold or manage local state.

class MyClassComponent extends React.Component { 
render() {
return (
<div>This is a Class component.</div>
);
}
}

export default MyClassComponent

Functional components

The functional component is also known as a stateless component because they do not hold or manage state.

function WelcomeUserName(props) { 
return <h1>Welcome, {props.name}</h1>;
}

or

export const Parent : () => {

const name = "John";
const address = "address";

return(
<Child
name = {name}
address = {address}
></Child>
};

Summary

In this article, we learnt about what is Reactjs, also saw what is component and its types.
Please let us know in the comments below about your thoughts and queries.
Hope you liked it !


Leave a Comment