Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

285
Vistas
Updataing react js code written with firebase v8

I have updated my firebase's version and because of the breaking changes of firebase v9 the code doesn't work now. I have change the firebase.js file to how it need's to be. and inported 👇 firebase/auth. I have played with the code but can't get it to work. Any help is appreciated.

import { signInWithPopup, getAuth, GoogleAuthProvider } from 'firebase/auth'

const [postPopUp, setpostPopUp] = useState(false)
const [isUserSignedIn, setIsUserSignedIn] = useState(true)
const [UserIcon, setUserIcon] = useState('')

const SignInWithFireBase = () => {
  var google_provider = new firebase.auth.GoogleAuthProvider()
  firebase.auth().signInWithPopup(google_provider)
    .then((re) => {
      setUserIcon(re.additionalUserInfo.profile.picture)
      console.log(re)
    })
    .catch((err) => {
      console.log(err)
    })
}

firebase.auth().onAuthStateChanged((user) => {
  if (user) {
    return setIsUserSignedIn(true)
  } else {
    setIsUserSignedIn(false)
  }
})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda