in

Argument of type ‘firebase.default.auth.Auth’ is not assignable to parameter of type useAuthState


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. I’ve tried importing and casting



Source: https://stackoverflow.com/questions/70628540/argument-of-type-firebase-default-auth-auth-is-not-assignable-to-parameter-of

Invoice status button web component and example integration in javascript Frameworks

a Go package to generate many kinds of generative art