#Buenas estoy haciendo practicas con unos

1 messages · Page 1 of 1 (latest)

surreal reef
#

edit: en el componente AuthContext quite la linea del useAuth() y traje mi context de forma "normal" en el Login y ahora funciona bien. No me sirvio intentar hacer ese hook o lo hice mal 🥲

sleek swallow
#

Hola @surreal reef intenta dejarlo como lo tenias con el hook, pero cambialo por: const {handleLogin} = useAuth()

surreal reef
#

Hola @sleek swallow asi lo tenia, pero en consola me salia un error intermediate value() is undefined no se por que

sleek swallow
surreal reef
#

en el componente AuthContext solo hice este cambio

  const userAuth = useContext(AuthContext)
  return userAuth
}

-->

export const useAuth = () => useContext(AuthContext)

y ahora funciona normal 🤡 jajajaj

#

y ya en Login hago { handleLogin } = useAuth() y no me tira errores en consola

sleek swallow
#

@surreal reef manda captura del componente Login

surreal reef
sleek swallow
# surreal reef

Te funciona porque quitaste el if terciario, useAuth() ?? []

surreal reef
sleek swallow