DEV Community

Discussion on: What is useEffect Hook in ReactJS?How useEffect works and where to use it?

Collapse
 
chetan_atrawalkar profile image
Chetan Atrawalkar

Can I used multiple useEffect in one function.

Collapse
 
abdulwaqar844 profile image
Abdul Waqar

You can create multiply sub components then import them in parent component. In subcomponent, you can use useEffect hook as well as in the parent component.

Collapse
 
frankytse_07 profile image
Franky Tse • Edited

In short yes. Personally I follow the "Single Responsibility Principle" when it comes to useEffect