Loading...
This site is best viewed in a modern browser with JavaScript enabled.
Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.
Functional Components VS Class Components in React JS
SandiniJ
Functional Components:
Functional components are the more common components we use while working in React.
They are simple JavaScript functions & we can create a functional component to React by writing a JavaScript function.
Functions may or may not receive data as parameters
State-less or Dumb Component
Shorter to write
Class Component:
Most of the modern web apps built in ReactJS class components.
These components are simple classes which made up of multiple functions that add functionality to the application.
All class based components are child classes for the Component class of ReactJS.
State-full or Smart Component
Has life cycle hooks