react-firebase-hooks

React Hooks for Firebase.

APACHE-2.0 License

Downloads
256.3K
Stars
3.6K
Committers
59

Bot releases are hidden (Show)

react-firebase-hooks - Latest Release

Published by chrisbianca almost 2 years ago

Release Notes

Bug fixes

  • Fixes missing import for useIdToken - thanks @vwxyutarooo

Full Changelog: https://github.com/CSFrequency/react-firebase-hooks/compare/v5.1.0...v5.1.1

react-firebase-hooks -

Published by chrisbianca almost 2 years ago

Release Notes

It's been a while since the last release, so this has been a bit of a housekeeping release focused on landing outstanding PRs and resolving a few of the simpler issues that have been reported.

I'm aware there are some outstanding issues with React 18 that require some deeper investigation and these will be tackled in a future release.

Special thanks to @levino for putting a test framework in place and adding our first test. We would welcome PRs with additional tests to improve the resilience of the library!

New Hooks

  • [auth] Add useSendPasswordResetEmail - thanks to @mparsakia
  • [auth] Add useDeleteUser - thanks to @RobertSasak
  • [auth] Add useSignOut - thanks to @RobertSasak
  • [auth] Add useVerifyBeforeUpdateEmail - thanks to @skratchdot
  • [auth] Add useIdToken #223
  • [auth] Add useSendSignInLinkToEmail and useSignInWithEmailLink #261

New Features

  • [auth] useCollection and useDocument now supports an optional initialValue option which sets the default value for hooks. This had been missed in the upgrade from v3 to v4 - thanks to @mauriceackel and @dylanwatsonsoftware
  • [auth] All methods returned by the createUser and signInWithXXX hooks will return the UserCredential when successful #251
  • [auth] All methods returned by updateXXX and sendXXX hooks will return a boolean to indicate success or failure

Bug fixes

  • Ensure that all internal functions are wrapped in useCallback to prevent unnecessary renders - thanks to @wong2 and @pzmudzinski

Full Changelog: https://github.com/CSFrequency/react-firebase-hooks/compare/v5.0.3...v5.1.0

react-firebase-hooks -

Published by chrisbianca over 2 years ago

Release Notes

Bug fixes

  • [auth] Correctly clear the error message when re-submitting the update functions #213 - thanks @cargallo
  • [functions] Fix HttpsCallable return type #210 - thanks @sanny-io
react-firebase-hooks -

Published by chrisbianca over 2 years ago

Release Notes

Bug fixes

  • [firestore] Prevent unnecessary re-renders when specifying options to hooks #207
react-firebase-hooks -

Published by chrisbianca over 2 years ago

Release Notes

Bug fixes

  • [auth] Remove unnecessary check to see if user is logged in with useSendPasswordResetEmail #205
react-firebase-hooks - v5.0.0

Published by chrisbianca over 2 years ago

Release Notes

This is one of the biggest releases for a while, bringing a raft of simplifications to the underlying code and a number of new hooks to support a greater breadth of Firebase functionality.

Breaking Changes

  • [firestore] useCollectionData and useDocumentData hooks no longer supports idField, refField or transform options as these are incompatible with the new Firebase v9 typings. Instead, use the built in FirestoreDataConverter functionality to control how the snapshots returned by Firebase are converted.
  • [typings] Flow typings have been removed as they were wildly out of date

New Hooks

  • [auth] Add a number of social login hooks: useSignInWithApple, useSignInWithFacebook, useSignInWithGithub, useSignInWithGoogle, useSignInWithMicrosoft, useSignInWithTwitter and useSignInWithYahoo - thanks to @isaiah-solo for the original useSignInWithGoogle hook that was adapted.
  • [auth] Add a number of user update hooks: useUpdateEmail, useUpdatePassword and useUpdateProfile
  • [auth] Add a couple of email hooks: useSendPasswordResetEmail and useSendEmailVerification
  • [functions] Add the useHttpsCallable hook to allow callable Cloud Functions to be executed
  • [messaging] Add the useToken hook to allow access to the Cloud Messaging token
  • [storage] Add the useUploadFile hook to allow files to be uploaded to Cloud Storage - thanks to @dohomi for the inspiration

New Features

  • [auth] useAuthState now supports an optional onUserChanged option to allow custom functions to be called when a user changes, e.g. to access custom claims (#139) - thanks to @dohomi
  • [firestore] useCollectionData and useDocumentData now return the snapshot object to allow access to things like metadata
  • [firestore] use***Once hooks now return a reload function to allow manual reloading of the data

Bug fixes

  • [firestore] use***Once hooks now protect against race conditions (#201) - thanks to @mrtnkb

Full Changelog: https://github.com/CSFrequency/react-firebase-hooks/compare/v4.0.1...v5.0.0

react-firebase-hooks -

Published by chrisbianca almost 3 years ago

Release Notes

Bug fixes

  • [firestore] Add inactive request protection to Firestore *Once methods (#201, fixes #194) - thanks to @mrtnkb
react-firebase-hooks -

Published by chrisbianca almost 3 years ago

Release Notes

New features

  • [firestore] Add support for initialValue when using Firestore data hooks (#190 and #191 ) - thanks to @dylanwatsonsoftware
react-firebase-hooks -

Published by chrisbianca almost 3 years ago

Release Notes

Bug fixes

  • [firestore] Update snapshot.exists to a method call (#179) - thanks to @dsvgit
react-firebase-hooks -

Published by chrisbianca almost 3 years ago

Release Notes

A big thank you to @andipaetzold who made the underlying changes for this release.

Breaking Changes

  • This release updates react-firebase-hooks to support Firebase v9, the new modular SDK from Firebase. Whilst there should be no changes required to the way that you interact with react-firebase-hooks, a number of changes will need to be made to how you interact with the underlying Firebase SDKs. More can be found here.
react-firebase-hooks -

Published by chrisbianca over 3 years ago

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
react-firebase-hooks -

Published by chrisbianca over 3 years ago

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
react-firebase-hooks -

Published by chrisbianca over 3 years ago

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
react-firebase-hooks -

Published by chrisbianca over 3 years ago

react-firebase-hooks -

Published by chrisbianca over 3 years ago

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)
react-firebase-hooks -

Published by chrisbianca over 4 years ago

Improvements

react-firebase-hooks -

Published by chrisbianca almost 5 years ago

Bug fixes

  • Typescript now includes the utils directory correctly #28
react-firebase-hooks -

Published by chrisbianca about 5 years ago

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
react-firebase-hooks -

Published by chrisbianca over 5 years ago

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
react-firebase-hooks -

Published by chrisbianca over 5 years ago

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