Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

294
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda