title: How to get info from firebase firestore database in react-native
body: <p>I am trying to get the logged-in user info from my firestore database in my react native app.</p>
  <p>I am new to react native, therefore I don't know the correct syntax or methodology to do these things with firestore.</p>
  <p>I've read many documentations but they don't provide information for every situation and instance.</p>
  <p>here is my code:</p>
  <p>my AuthProvider.js:</p>
  <pre><code>export const AuthContext = createContext();
  export const AuthProvider = ({children}) =&gt; {
  const [user,setUser] = useState(null);
  </code></pre>
  <p>my profileScreen.js:</p>
  <pre><code>const {user} = useContext(AuthContext);
  
    const snapshot =  firestore().collection('Users').doc(user.uid).get();
  
    const name = snapshot(&quot;name&quot;);
    const email = snapshot(&quot;email&quot;); //this code gives me and error, 
    snapshot is not a function, snapshot is an instance of a promise
  </code></pre>
  <p>How can I fetch a single user's information, or in general how can I fetch information from firestore with react-native?</p>
  <p>UPDATE:</p>
  <p>i tried this following code, but in the console i get undefined for the name. why is that?</p>
  <pre><code>        firestore()
          .collection(&quot;Users&quot;)
          .doc(user.uid)
          .get()
          .then((snapshot) =&gt; {
            const name = snapshot.name
            console.log(name)
          });
  </code></pre>