The FAQ of React docs site encourage us to adapt to functional components and hooks:
When you’re ready, we’d encourage you to start trying Hooks in new components you write.
The only reason which never have described by even React docs in details is functional components are cleaner and much-easier-to-read ones. You can understand functionality of a component by glimpsing.
Consider you want to use
- In class-based components these are separate methods which may need interactions with each other. Also they can't be redeclared in the component.
- But by using
useEffecthook, you can have multiple
componentWillUnmountfunctionalities in your components and therefore this and other reasons which you may have faced cause much easier codes for comprehension.