简体   繁体   中英

firebase.User in firebase version 9

I'm writing a new app with React, typescript and firebase. I'm working on the AuthContext and in a tutorial I found I see these lines:

import firebase from "firebase/app";

const [user, setUser] = useState<firebase.User | null>(null);

 

But the import import firebase from "firebase/app"; does not exist on firebase 9 and I can't find the equivalent of firebase.User

Can anyone help?

I am not familiar with React and AuthContext but maybe this can help. This is how User type can be imported in typescript and in Firebase v9:

import { User } from "firebase/auth";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM