title: Get user object properties from Firebase in React
body: <p>I have a user db in Firebase that uses the unique user id as the Key and within that key/value pairs like name: 'jane doe', email: 'jane@doe.com', etc.  What I want to do is map the object and get the key values within.  I'm able to get the Key (user id), but not the object key value pairs.  Here's my code: </p>
  
  <pre><code>  export default class Home extends Component {
  
      constructor(props) {
       super(props);
  
       var users = {};
       this.state = { users };
     }
  
     componentDidMount() {
      const dbRoot = firebaseDb.database().ref().child('users');
  
      dbRoot.on('value', snap =&gt; {
       const dbUsers = snap.val(); 
  
       this.setState({
         users: dbUsers
       });
     });
  }
  
  
    render() {
      return (
        &lt;div&gt;
          &lt;div&gt;
            {Object.keys(this.state.users).map(function(user, i) {
              return &lt;div key={i}&gt;Key: {user}, Value: {user.name}&lt;/div&gt;;
            })}
          &lt;/div&gt;
      &lt;/div&gt;);
  
    }
  
  }
  </code></pre>
  
  <p>user.name comes back undefined.  I've tried using this.state.users.name but I get a "state is undefined" message.  Can someone point me in the right direction.  Thanks!</p>