Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FirestoreDocument within a FirestoreCollection #13

Open
isobarwill opened this issue Dec 29, 2018 · 1 comment
Open

FirestoreDocument within a FirestoreCollection #13

isobarwill opened this issue Dec 29, 2018 · 1 comment

Comments

@isobarwill
Copy link

Thanks for creating this library. Great job!

I have a unique case where I am attempting to render FirestoreDocument with a dynamic path. For example:

                      <FirestoreCollection path={parentPath} >
                        {items => {
                          return items.value ? (
                            <FlatList
                              data={items.value}
                              renderItem={({ item }) => (     
                                //item.ref is a Firestore reference type
                                <FirestoreDocument path={item.ref.path}>
                                  {match => {
                                    return match.value ? (
                                      <Text>Never rendered</Text>
                                    ) : (
                                      <Text> Loading.....forever</Text>
                                    );
                                  }}
                                </FirestoreDocument>
                              )}
                            />
                          ) : (
                               <Text> Loading...</Text>
                          );
                        }}
                      </FirestoreCollection>

match.value is always null.

Thanks!

@rakannimer
Copy link
Owner

rakannimer commented Dec 31, 2018

Hey @isobarwill ,

Thanks for reporting the issue.
Your use-case makes sense to me, does the collection render and did you make sure the path is arriving as expected to the child ?

If you could fork one of the sandboxes and try to reproduce that would be awesome too !

Cheers !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants