Next.js with reactStrictMode the useDocumentOnce snapshot is never retrived
jasan-s opened this issue · 3 comments
with reactStrictMode=true in the next.config.js during development the useDocumentOnce never retrieves the snapshot data with useDocumentOnce , the loading remains true
If i set reactStrictMode=false useDocumentOnce retrieves the data correctly.
my currect hack is the following:
const [snapshot, loading, error] =
process && process.env.NODE_ENV === 'development'
? useDocument(doc(getFirestore(firebaseApp), 'collection', 'documentId'))
: useDocumentOnce(doc(getFirestore(firebaseApp), 'collection', 'documentId'))
Hello guys ! I also had the same issue !
Here are my project informations:
"next": "12.2.3",
"react-firebase-hooks": "^5.0.3",
"firebase": "^9.9.4",
Hi everybody, apologies for the delay in investigating this properly. I've just given this a try and it appears that some of the changes I've made in the newly released v5.1.0 may have inadvertently resolved this issue.
Could I ask you to try v5.1.0 and check whether this has been fixed?
I am closing this issue as it has been confirmed working in #252, but if anybody else is still struggling, please let me know and I can look into it further!