React functional components vs classical components

2022 Update

You only need a class component when you:

  • need to create an error boundary using componentDidCatch

Original 2016 Answer

You only need a class component when you:

  • need the component state or
  • need the lifecycle methods. such as componentDidMount etc.

Leave a Comment

tech