Skip to main content

What is the diff between class vs functional components?

  • The class component uses ES6 class syntax, and it extends React components with a render method that returns React elements.

  • Functional components with hooks are purely JavaScript functions that also return React elements. Before the introduction of hooks, functional components were stateless.