I'm trying to configure react-redux-firebase to work with redux-firestore. I followed the example setup from the official Docs and everything seems to work until i wire up a component with firestorConnect from react-redux-firebase. As soon as the connected Component mounts I get the following error:
Uncaught Error: Collection is required to build query name
This is how I am attempting to connect my component:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { compose } from 'redux';
import { firestoreConnect } from 'react-redux-firebase';
export class TestComponent extends Component {
render() {
return <div>test</div>;
}
}
export default compose(
firestoreConnect(['test']),
connect(state => ({
test: state.firestore.ordered.test
}))
)(TestComponent);
Update
The Problem could be resolved by specifying the collections in the following way:
firestoreConnect([{ collecion: 'test' }])
That's strange because the official Docs, state that the follwoing should also work.
import { compose } from 'redux'
import { connect } from 'react-redux'
import { firestoreConnect } from 'react-redux-firebase'
export default compose(
firestoreConnect(['todos']), // or { collection: 'todos' }
connect((state, props) => ({
todos: state.firestore.ordered.todos
}))
)(SomeComponent)
I'm puzzled.