Open francisleigh opened 4 years ago
@FrancisLeigh You still need to use populate
when pulling data out of redux. profileParamsToPopulate
just creates the listeners for the necessary data to go into redux. Like so:
export const profilePopulates = [{ child: 'contacts', root: 'users' }]
const config = {
userProfile: 'users',
profileParamsToPopulate: profilePopulates
}
// Then later
connect(({ firebase }) => ({
profileWithContacts: populate(firebase, 'profile', profilePopulates),
}))(Component);
This is described in the populate role example within the recipes section of the docs.
I am working with React native
Hello, I am following these steps http://react-redux-firebase.com/docs/recipes/profile.html#populate-parameters but can't seem to get the described output.
"react-redux-firebase": "^3.1.2",
My realtime database structure looks like this:
But when i log
contacts
on my page (when i am logged in asfrancis100@test.com
i just get the raw contacts array with Georgia's user ID inside it. I would expect to get:but get:
["WaA5NpF8m2gaaeKnXI8tkYcCdR13"]
The component i log contacts from is connected to firebase via redux's
connect
I hope i'm just missing a step and this is just me being a firebase & react-redux-firebase noob. :-)
Thank you!