Minor Changes
-
#20
ca73117Thanks @Timonwa! - Theauthargument is now optional. Below anAuthProvider, hooks take the instance from it, so an app no longer names the same object at every call site:const { login } = useLogin(); const { signup } = useSignup({ sendVerificationEmail: false });
Passing your own still works and overrides the provider's — what you need for a second Firebase project, or with no provider at all.
nullkeeps its existing meaning of "not ready yet, don't run", so a hook held back while Firebase initialises never silently runs against the provider's instance instead.Breaking:
useUpdatePasswordanduseUpdateEmailtake the new value positionally, matching the Firebase SDK they wrap anduseSignup's existing shape.// Before await update({ newPassword, currentPassword }); await update({ newEmail, currentPassword }); // After await update(newPassword, { currentPassword }); await update(newEmail, { currentPassword });
Firebase's own
updatePassword(user, newPassword)andverifyBeforeUpdateEmail(user, newEmail)lead with the required value;currentPasswordis the reauthentication these hooks add on top, so it belongs in the options bag after it.useUpdateProfileis unchanged — its fields are all optional, which is why the SDK passes them as an object too.Nothing else changes: every existing
useLogin(auth, options)call keeps working.