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 ?
-
reactjs.org/docs/…Murat Karagöz– Murat Karagöz2019-04-18 21:56:16 +00:00Commented Apr 18, 2019 at 21:56
Add a comment
|
1 Answer
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.