0
When to use a Class Component over a Function Component?

Open 1 Answers 6 Views Education
When to use a Class Component over a Function Component?

1 Answer

0

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

by (280k points)
...