Hi, I enjoy your posts, always clear and insightful!😎
In the code snippet with useEffect, I wondered if missing dependencies could cause unexpected behavior?
useEffect(() => {
if (!isAuthenticated && !currentUser.isLoading) {
router.push("/"); // or login page
}
},
// missing isAuthenticated and
// currentUser.isLoading
[Component, isAuthenticated, currentUser.isLoading]);
Great job, and eager for your future posts!