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 556 forks source link

Error in typescript example - codesandbox example inside. #912

Closed dhuber666 closed 4 years ago

dhuber666 commented 4 years ago

Look at this line from the example:

https://github.com/prescottprue/react-redux-firebase/blob/cd8bfba717108b799b8416121233ce0556fed618/examples/complete/typescript/src/reducer.ts#L20

I did exactly the same thing and in the combineReducer call it looks like this:

const rootReducer = combineReducers<RootState>({
  firebase: firebaseReducer,
  firestore: firestoreReducer,
});

But I get this error:

(property) firestore: Reducer<FirestoreReducer.Reducer, any> No overload matches this call. Overload 1 of 3,

Here is a minimal codesandbox link:

https://codesandbox.io/s/great-perlman-p6g7p?file=/src/store/index.ts

(Error at line 54 )

It is a brand new project with all the libraries @latest

I think the error might be that the types from FirestoreReducer.Reducer looks correct but the returned value from firestoreReducer is a function that returns any.

Thx and awesome lib! Dom

prescottprue commented 4 years ago

Going to close since it seems like it was solved by the above noted PR - please reach out if that is not the case