title: Using Flow - How to use DocumentRef to check type of DataSnapshot fields?
body: <p>I created a function to iterate through all fields of a <code>DataSnapshot</code>.</p>
  
  <p>Here are my imports</p>
  
  <pre><code>import type {
    DataSnapshot,
    DocumentRef,
    DocumentSnapshot,
  } from 'react-native-firebase';
  </code></pre>
  
  <p>the function is below:</p>
  
  <pre><code>getRefData = (data: typeof DataSnapshot) {
     return new Promise(async (resolve: Function) =&gt;{
        const refs = await Object.keys(data).map((key: string) =&gt; {
           const field = data[key];
           if (field instanceof DocumentRef) {
               /// LOGIC HERE
           }
        });
  
     });
  };
  </code></pre>
  
  <p>I'd actually like to add some logic if field is a <code>DocumentRef</code>. It is even undefined, see error below:</p>
  
  <pre><code>Unhandled rejection is {promise: Promise, reason: ReferenceError: DocumentRef is not defined
      at blob:http://localhost:8081/68a9c3b0-2327-429a-b5c7…}
  </code></pre>
  
  <p>Is there a different or straightforward way to do this? What could've gone wrong?</p>