I'm trying to map my giveaways collection in firestore to my props in Shop.js, but firestoreConnect isn't doing anything. When I print out state.firestore.ordered in mapStateToProps I get Object{}, and state.firestore.ordered.giveaways is undefined.
Is there something wrong with my configuration? The react-redux-firebase documentation makes it look like everything's here.
Shop.js
const giveaways = state.firestore.ordered.giveaways;
console.log("=====================================================");
console.log(giveaways);
return {
profile: state.firebase.profile,
giveaways: state.firestore.ordered.giveaways
}
}
export default compose (
firestoreConnect(() =>{
{collection: 'femaleClothes'}
}),
connect(mapStateToProps),
)(Shop);
fbConfig.js looks like this
import firebase from 'firebase/app'
import 'firebase/firestore'
import 'firebase/auth'
var firebaseConfig = { /*firebase config information*/};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
//firebase.analytics();
firebase.firestore();
export default firebase;
and the relevant parts of App.js
const store = createStore(rootReducer,
compose(
applyMiddleware(thunk.withExtraArgument({getFirebase,getFirestore})),
reduxFirestore(fbConfig)
)
);
const rrfConfig = {
userProfile: 'users',
useFirestoreForProfile: true
}
const rrfProps = {
firebase,
config: rrfConfig,
dispatch: store.dispatch,
createFirestoreInstance,
}
export default function App() {
return (
<Provider store={store}>
<ReactReduxFirebaseProvider {...rrfProps}>
<AuthIsLoaded>
<NavigationContainer>
<AuthNavigator/>
</NavigationContainer>
</AuthIsLoaded>
</ReactReduxFirebaseProvider>
</Provider>
);
};