From e82b66959b4976a7b4eef0a5db865f15516f2565 Mon Sep 17 00:00:00 2001 From: jahooma Date: Thu, 16 Dec 2021 22:17:33 -0600 Subject: [PATCH] Switch back to useEffect instead of useLayoutEffect, because nextjs complained. --- web/hooks/use-user.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/hooks/use-user.ts b/web/hooks/use-user.ts index 24075851..ca7f6191 100644 --- a/web/hooks/use-user.ts +++ b/web/hooks/use-user.ts @@ -1,11 +1,10 @@ -import { useEffect, useLayoutEffect, useState } from 'react' +import { useEffect, useState } from 'react' import { listenForLogin, listenForUser, User } from '../lib/firebase/users' export const useUser = () => { const [user, setUser] = useState(undefined) - // Use layout effect to trigger re-render before first paint. - useLayoutEffect(() => listenForLogin(setUser), []) + useEffect(() => listenForLogin(setUser), []) const userId = user?.id