My code is extensive, so I have only included a portion that I believe is crucial.
import {getAuth} from "firebase/auth"
const authFirebase = getAuth()
console.log(authFirebase)
const Home = () => {
...
return(
...
)
}
Every time I refresh the page (F5) if I just.
console.log(authFirebase)
When I retrieve an object containing uid in the currentUser property and code like this.
console.log(authFirebase.currentUser.uid)
I encounter this error
TypeError: Cannot read properties of null (reading 'uid')
I am confused; there must be something about Firebase that I'm missing?