I'm trying to call the useAuthState hook from the react-firebase-hooks npm package but I'm getting the following error:
Argument of type 'firebase.default.auth.Auth' is not assignable to parameter of type 'import("C:/path/1/node_modules/@firebase/auth/dist/auth-public").Auth'.
Types of property 'setPersistence' are incompatible.
Type '(persistence: string) => Promise<void>' is not assignable to type '(persistence: Persistence) => Promise<void>'.
Types of parameters 'persistence' and 'persistence' are incompatible.
Type 'Persistence' is not assignable to type 'string'.
The relevant code is as follows in my hooks.ts file:
import firebase from 'firebase/compat/app'
export function useUserData() {
const [user] = useAuthState(firebase.auth())
^^^^^^^^^ here is the error
}
I think I'm supposed to typecast in some capacity and use angle brackets like so useAuthState<someDataType>(firebase.auth)) but I'm not sure what type will aid the error.