Can you call useEffect inside a conditional statement?
No, you cannot call useEffect inside a conditional statement. React's rules of hooks require that hooks must always be called at the top level of the component. This ensures the order of hooks is consistent between renders, avoiding bugs.