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

284
Views
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
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!