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

state.firestore.ordered.projects always getting null result #1056

Open satyendrasingh8 opened 3 years ago

satyendrasingh8 commented 3 years ago

const mapStateToProps = (state) => { console.log(state) return { projects:state.firestore.ordered.projects } }

export default compose( connect(mapStateToProps), firestoreConnect([ { collection: 'projects' },

]) )(HomeContent)

error:

TypeError: Cannot read property 'dispatch' of null (anonymous function) D:/webserv4u/src/firestoreConnect.js:113 110 | {(_internalFirestore) => ( 111 | <FirestoreConnectWrapped 112 | {...props}

113 | dispatch={_internalFirebase.dispatch} | ^ 114 | firestore={_internalFirestore} 115 | firebase={_internalFirebase} 116 | />

Which versions of dependencies, and which browser and OS are affected by this issue? Did this work in previous versions or setups?

prescottprue commented 3 years ago

Could you prove a full repro including setup? Seems like firebase instance isn't being picked up

bk973 commented 3 years ago

Jump to using hooks... useFirestoreConnect() from 'react-redux-firebase' useSelector() from 'react-redux'