Home > Software design >  How to properly display Firebase Auth error to user using Toast and Typescript?
How to properly display Firebase Auth error to user using Toast and Typescript?

Time:03-12

Suppose the user wanted to sign up or sign in to the account. However, the Firebase error appears like this. How can I display the toast notification to the user using try-catch statement with typescript?

[FirebaseError: Firebase: Error (auth/email-already-in-use).]

Here is the code I tried:

    try {
      const credential = await signUpWithEmail(data.email, data.password);
      if (credential.uid) {
        toast.show({
          title: 'Account created!            
  • Related