×

Html & Html5

The World's best Software Development Study Portal

Components

In the Components, we will understand the types and how to reuse of Components. There are 2 type of Components in react js
1. Stateless Functional Components
2. Statefull Class Components

Stateless Functional Components

Javascript Functions

function new(props){
return

Hello, {props.name}

}

Stateful Class Components

Class extending components class
Render method returning html

function new extends React.component{
render(){
return

Hello, {this.props.name}

} }

Components Summary


1. Components are the parts of user interface

2. Components are reusable can be nested inside the others.