React is a most popular front-end language, and is famous for its ease and readability and it also allow company to adopt its environment very easily.
React mainly used class components, with react hooks we can do we can switch between classes,higher order components and render props.
Hooks make react so much simpler that implements simple functionality faster and effectively.
This code is for class component that print "hello world " in the DOM:
import React, { Component } from 'react'
export default class Hello extends Component {
render() {
return(
<div>
Hello World!
</div>
)
}
}
This code is for functional component that prints “Hello World” on the DOM.
import React from 'react'
export default function Hello() {
return (
<div>
Hello World!
</div>
)
}