NextAuth/4/UseSession Array To Object Destructuring

1.0.0Last update Aug 21, 2024
by@manishjha-04

The useSession hook has been updated to return an object. This allows you to test states much more cleanly with the new status option.

Before

const [session, loading] = useSession();

After

const { data: session, status } = useSession();
const loading = status === 'loading';

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now