Skip to content

Releases: CSFrequency/react-firebase-hooks

v3.0.4

24 Apr 06:47
Compare
Choose a tag to compare

Release Notes

Bug fixes

  • [database] Fix useList when a new child is added (#141) - thanks to @cryser29
  • [types] Export IDOptions to prevent tsc compilation issues (#135) - thanks to @Snailed
  • [types] Export AuthActionHook to prevent compilation issues. Fixes #127

v3.0.3

19 Mar 08:40
Compare
Choose a tag to compare

Release Notes

New features

  • [auth] Add support for emailVerificationOptions when using useCreateUserWithEmailAndPassword (#125 and #130) - thanks to @dohomi

Bug fixes

  • [database] Correctly type refField as Reference
  • [firestore] Correctly type refField as DocumentReference (#126 ) - thanks to @dangreaves
  • [firestore] Correctly support withConverter (#129) - thanks to @berdyshev

v3.0.2

09 Mar 08:27
Compare
Choose a tag to compare

Release Notes

Bug fixes

  • [auth] Remove unnecessary firebase/auth import to reduce bundle size (#122) - thanks to @exKAZUu
  • [firestore] Fix issues with DocumentData typescript typings (#120) - thanks to @dangreaves for the suggested fix

v3.0.1

02 Mar 08:30
Compare
Choose a tag to compare

Release Notes

Breaking Changes

  • Due to changes in the underlying Firebase types, v3 of react-firebase-hooks requires Firebase v8 or higher (#86) - thanks to @mdirolf

New Features

  • [auth] Add useCreateUserWithEmailAndPassword and useSignInWithEmailAndPassword hooks (#98) - thanks to @lorstenoplo
  • [database] Add transform option for realtime database hooks (#95) - thanks to @Satyam
  • [firestore] Add an optional refField that is populated with the firebase.firestore.QuerySnapshot.ref property (#80) - thanks to @mauriceackel
  • [firestore] Add support for snapshotOptions (#78)
  • [firestore] Add transform option for firestore hooks

Performance Improvements

  • Responses from all hooks are now memoized to prevent unnecessary renders (#79) - thanks to @sdemjanenko
  • [database] Improve useList efficiency (#90) - thanks to @caleb-harrelson

Typing Improvements

  • [auth] Fix return type for useAuthState (#107) - thanks to @kqito
  • [database] Add keyField and refField to generics
  • [firestore] Add generics to allow the returned data to be typed (#75) - thanks to @Lynges
  • [firestore] Add idField and refField to generics (#50)
  • [firestore] Add additional firestore.DocumentReference type information to all hooks (#67)

v3.0.0

02 Mar 08:52
Compare
Choose a tag to compare

v2.2.0

25 May 11:20
Compare
Choose a tag to compare

Improvements

  • Add useMemo() for value fetching hooks to prevent unnecessary re-renders #41 - thanks to @ypresto

v2.1.1

11 Nov 09:12
Compare
Choose a tag to compare

Bug fixes

  • Typescript now includes the utils directory correctly #28

v2.1.0

02 Aug 08:12
Compare
Choose a tag to compare

Bug fixes

  • Typescript now explicitly returns undefined instead of void #26
  • Correctly clear value field when Firebase returns an error
  • Correctly clear error field when Firebase returns a value
  • Catch errors from realtime database listeners

v2.0.0

21 May 07:54
Compare
Choose a tag to compare

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 now useCollection(query, { snapshotListenOptions })
      • useCollectionOnce(query, options) is now useCollectionOnce(query, { getOptions })
      • useCollectionData(query, options, idField) is now useCollectionData(query, { idField, snapshotListenOptions })
      • useCollectionDataOnce(query, options, idField) is now useCollectionDataOnce(query, { getOptions, idField })
      • useDocument(ref, options) is now useDocument(ref, { snapshotListenOptions })
      • useDocumentOnce(ref, options) is now useDocumentOnce(ref, { getOptions })
      • useDocumentData(ref, options, idField) is now useDocumentData(ref, { idField, snapshotListenOptions })
      • useDocumentDataOnce(ref, options, idField) is now useDocumentDataOnce(ref, { getOptions, idField })
    • Database:

      • useListVals<T>(ref, keyField) is now useListVals<T>(ref, { keyField })
      • useObjectVal<T>(ref, keyField) is now useObjectVal<T>(ref, { keyField })
  • Auth hooks now return firebase.auth.Error rather than firebase.FirebaseError as this is what the auth methods return from the SDK
  • Firestore hooks now return Error rather than firebase.FirebaseError as this is what the firestore methods return from the SDK

New Features

  • Overhauled documentation to make it easier to read
  • Reworked behind the scenes to better re-use code

v1.2.1

07 May 14:55
Compare
Choose a tag to compare

Bug fixes

  • #18 Return FirebaseError rather than object type - thanks @lucacasonato
  • #19 Return null instead of empty object when document doesn't exist - thanks @cmmartin