prescottprue / react-redux-firebase

Redux bindings for Firebase. Includes React Hooks and Higher Order Components.
https://react-redux-firebase.com
MIT License
2.55k stars 559 forks source link

bug(types): handleRedirectResult does not exist on extended firebase instance #987

Closed DavidConstantine88 closed 3 years ago

DavidConstantine88 commented 4 years ago

Hi, I'm trying to move my project to TypeScript.

and it seems like there is an issue in he way firebase extended in react-redux-firebase

https://github.com/prescottprue/react-redux-firebase/blob/master/src/createFirebaseInstance.js

  firebaseInstance = Object.assign(firebase, {
    _reactReduxFirebaseExtended: true,
    ref: (path) => firebase.database().ref(path),
    set,
    setWithMeta,
    uniqueSet,
    push,
    pushWithMeta,
    remove,
    update,
    updateWithMeta,
    login,
    reauthenticate,
    handleRedirectResult,
    logout,
    updateAuth,
    updateEmail,
    updateProfile,
    uploadFile,
    uploadFiles,
    deleteFile,
    createUser,
    resetPassword,
    confirmPasswordReset,
    verifyPasswordResetCode,
    watchEvent,
    unWatchEvent,
    reloadAuth,
    linkWithCredential,
    promiseEvents,
    dispatch,
    ...actionCreators
  })
  return firebaseInstance

when I try to use in my code firebase.handleRedirectResult looks like it doesn't able to recognize that firebase has that method.

What would be a good way to support it?

firebase Type is defined as ExtendedFirebaseInstance & ExtendedAuthInstance & ExtendedStorageInstance

and it doesn't contain all this assigned methods

prescottprue commented 3 years ago

The v3.8.1 release includes a fix for this. Reach out if it isn't working as expected thanks for reporting!