title: Problem creating document within subcollection
body: <p>I'm working on a signup form. User registers, then in Firebase in the "companies" collection I add a new company, then a "users" collection is added under the just-created company, and the just-created user is added as a document to the company.</p>
  
  <p>Everything is working fine until my code tries to add a new collection "users" under the just created company. Here's my code thus far:</p>
  
  <pre><code>return async (dispatch, getState) =&gt; {
      try {
          const { companyName, email, password } = getState().user;
          const response = await Firebase.auth().createUserWithEmailAndPassword(
              email,
              password
          );
          if (response.user.uid) {
  
              // Set up company
              const company = {
                  name: companyName,
                  owner: response.user.uid
              };
  
              // Create company
              db.collection("companies")
                  .add(company)
                  .then(ref =&gt; {
  
                      console.log("Company ID ", ref.id);
                      console.log("User ID ", response.user.uid);
  
                      // Set up first user
                      const user = {
                          uid: response.user.uid,
                          email: email
                      };
  
                      // Add first User
                      db.doc(ref.id)
                          .collection("users")
                          .add(user);
  
                  });
  
              dispatch({ type: SIGNUP, payload: user });
          }
      } catch (e) {
          alert(e);
      }
  };
  </code></pre>
  
  <p>Those console.logs return the correct IDs, So it looks like there's an issue with how my reference to the just-created company is being created? How would I fix that?</p>