Comments (2)
i have similar issues with react in production. To get the user, i stick to reactQuery
import { useQuery } from "react-query";
const authUser = useQuery(["authUser"], () => auth)
from react-query-firebase.
Also seemed to have issues with useAuthUser
in production. I'm currently using a simple hook with unsubscribe functionality. Seems to be working nicely 🙂
import { User } from 'firebase/auth'
import { useEffect, useState } from 'react'
import { auth } from '../services/firebase'
export const useAuthUser = () => {
const [authUser, setAuthUser] = useState<User | null>(null)
useEffect(() => {
const unsubscribe = auth.onAuthStateChanged(authUser => {
setAuthUser(authUser)
})
return () => {
unsubscribe()
}
}, [])
return authUser
}
from react-query-firebase.
Related Issues (20)
- Is this repo still being worked on... HOT 5
- Querying firestore documents with subscribe never fetches HOT 8
- How to write tests for this hooks using Jest/RTL?
- 1.0.0-dev7: useFirestoreDocumentData does not update invalidated data (react 18.2.0, react-query 3.39.2) HOT 1
- Dependent Queries HOT 2
- Uncaught ReferenceError: Cannot access 'query' before initialization HOT 3
- How do I pass variables to hooks? HOT 2
- Dependency issue HOT 1
- TypeError: can't access property "delete", _firebase_util__WEBPACK_IMPORTED_MODULE_0__.getModularInstance(...) is undefined HOT 1
- useFirestoreQuery() - duplicate firebase SDK HOT 1
- Can this package be used with react native? authentication does not pick up google login
- NextJS 13 - Auth Checking is not working as expected HOT 1
- useFirestoreInfiniteQuery() - data.page is null or undefined when refreshing page HOT 1
- Enabled option error HOT 1
- Can not pass mutation of useAuthSignOut as dependencies of useEffect
- Maintainers? HOT 3
- firebase v10 HOT 2
- How can I perform nested collection queries?
- [FR] Support Firebase JS SDK v10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-query-firebase.