Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

167
Views
Mi AuthContext funciona por un tiempo y muestra el nombre para mostrar, luego aparece este error una vez que se actualiza la página

Usando Firebase 9: cuando comento el nombre de usuario.displayname, no hay errores. Cuando elimine el comentario, mostrará el displayName en la barra de navegación; sin embargo, cuando actualice la página o haga clic, obtendré los siguientes errores a continuación.

TypeError: no se pueden leer las propiedades de nulo (leyendo 'displayName')

 src/components/Navbar.js:13 10 | return ( 11 | <nav> 12 | <h1>My Reading List</h1> > 13 | <p>{user.displayName}</p> | ^ 14 | <ul> 15 | <li> 16 | <Link to="/">Home</Link> (anonymous function) src/context/AuthContext.js:28 25 | 26 | useEffect(() => { 27 | const unsub = onAuthStateChanged(auth, (user) => { > 28 | dispatch({ type: "AUTH_IS_READY", payload: user }); | ^ 29 | unsub(); 30 | }); 31 | }, []); 514 | _assert(promise, this, AuthErrorCode.INTERNAL_ERROR); 515 | // The callback needs to be called asynchronously per the spec. 516 | // eslint-disable-next-line @typescript-eslint/no-floating-promises > 517 | promise.then(() => cb(this.currentUser)); | ^ 518 | 519 | if (typeof nextOrObserver === 'function') { 520 | return subscription.addObserver(nextOrObserver, error, completed)```
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Me di cuenta de que el error venía debido al estado de autenticación en la protección de rutas. Cuando aplique la protección de ruta, asegúrese de configurar sus permisos correctamente

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!