Reactjs – Inside of useEffect, both condition branches got triggered when refresh page
This is the useEffect code in the React component. import { useSession } from '@supabase/auth-helpers-react' const session = useSession() useEffect(() => { if (session) { console.debug('stay in page') } else { console.debug('goto login') router.push('/login').then( () => { console.debug('goto login done')…