When to use Class based component over a Functional component in ReactJS?

If the component needs state or lifecycle methods then in such cases, we can use class based component otherwise we use function component. However, from React 16.8 with the addition of Hooks, we could use state , lifecycle methods and other features that were only available in class component right in our function component.