2

After React Hooks were introduced in React 16.8 with all the new ways to control component's state and lifecycle methods in a functional component such as useState and useEffect, the remaining difference between a functional component and a class-based component isn't obvious anymore, so what's the real difference ?

1

1 Answer 1

2

There are some lifecycle methods, which can't be emulated with React Hooks(e.g. componentDidCatch()).

In this cases you still need class components, but overall, you don't need them, and it's already totally fine, if you have an app without them.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.