v2.0.0
Release Notes
Breaking Changes
- All hooks now return an array rather than an object to enable easier composition of hooks. The structure of this array is generally:
const [value, loading, error] = useHook();
- Any hooks with optional parameters now have a single
options
object parameter which contains all optional parameters:-
Firestore:
useCollection(query, options)
is nowuseCollection(query, { snapshotListenOptions })
useCollectionOnce(query, options)
is nowuseCollectionOnce(query, { getOptions })
useCollectionData(query, options, idField)
is nowuseCollectionData(query, { idField, snapshotListenOptions })
useCollectionDataOnce(query, options, idField)
is nowuseCollectionDataOnce(query, { getOptions, idField })
useDocument(ref, options)
is nowuseDocument(ref, { snapshotListenOptions })
useDocumentOnce(ref, options)
is nowuseDocumentOnce(ref, { getOptions })
useDocumentData(ref, options, idField)
is nowuseDocumentData(ref, { idField, snapshotListenOptions })
useDocumentDataOnce(ref, options, idField)
is nowuseDocumentDataOnce(ref, { getOptions, idField })
-
Database:
useListVals<T>(ref, keyField)
is nowuseListVals<T>(ref, { keyField })
useObjectVal<T>(ref, keyField)
is nowuseObjectVal<T>(ref, { keyField })
-
- Auth hooks now return
firebase.auth.Error
rather thanfirebase.FirebaseError
as this is what theauth
methods return from the SDK - Firestore hooks now return
Error
rather thanfirebase.FirebaseError
as this is what thefirestore
methods return from the SDK
New Features
- Overhauled documentation to make it easier to read
- Reworked behind the scenes to better re-use code