Skip to content

Firebaseui with reactfire in v9 #474

Answered by jhuleatt
codercatdev asked this question in Q&A
Discussion options

You must be logged in to vote

Here's an example of how to use Firebase v9 and ReactFire v4 normally throughout the rest of a web app, and only worry about the compat sdk in the component that sets up react-firebaseui's StyledFirebaseAuth:

import StyledFirebaseAuth from "react-firebaseui/StyledFirebaseAuth";
import { useAuth } from "reactfire";

// compat SDK needed for FirebaseUI
import firebase from "firebase/compat/app";
import "firebase/compat/auth";

export function SignInForm() {
  // get the v9 auth instance normally using ReactFire
  const v9AuthInstance = useAuth();

  // convert the v9 auth instance into a v8 auth instance
  const v8AppInstance = firebase.initializeApp(v9AuthInstance.app.options);
  const v8A…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@mankinchi
Comment options

@codercatdev
Comment options

@mankinchi
Comment options

@codercatdev
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jhuleatt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants