title: How can I fetch Firebase data (Realtime Database) that is an object, not an array?
body: <p>I'm new to coding and learning React Native and Firebase.</p>
  <p>I'm trying to fetch data from Firebase Realtime Database using Firebase API.</p>
  <pre><code>class UpdatedItem extends React.Component {
    state = {
      loading: false,
      data: [],
      page: 1,
      error: null,
      fullData: []
    }
  
    componentDidMount() {
      this.makeRemoteRequest()
    }
  
    makeRemoteRequest = () =&gt; {
      const { page } = this.state
      const url = `https://example-default-rtdb.firebaseio.com/dinosaur.json`
      this.setState({ loading: true })
  
      fetch(url)
        .then(res =&gt; res.json())
        .then(res =&gt; {
          this.setState({
            data: page === 1 ? [...this.state.data, ...res] : [...this.state.data, ...res],
            error: res.error || null,
            loading: false,
            fullData: res
          })
        })
        .catch(error =&gt; {
          this.setState({ error, loading: false })
        })
    }
  
    render() {
      console.log([...this.state.data])
  </code></pre>
  <p>I succeeded fetching data of an array as below.</p>
  <pre><code>[ {
    &quot;height&quot; : 2.1,
    &quot;length&quot; : 12.5,
    &quot;name&quot; : &quot;lambeosaurus&quot;,
    &quot;weight&quot; : 5000
  }, {
    &quot;height&quot; : 4,
    &quot;length&quot; : 9,
    &quot;name&quot; : &quot;stegosaurus&quot;,
    &quot;weight&quot; : 2500
  } ]
  </code></pre>
  <p>(Data in an array)</p>
  <pre><code>Array [
    Object {
      &quot;height&quot;: 2.1,
      &quot;length&quot;: 12.5,
      &quot;name&quot;: &quot;lambeosaurus&quot;,
      &quot;weight&quot;: 5000,
    },
    Object {
      &quot;height&quot;: 4,
      &quot;length&quot;: 9,
      &quot;name&quot;: &quot;stegosaurus&quot;,
      &quot;weight&quot;: 2500,
    },
  ]
  </code></pre>
  <p>(Result in the console)</p>
  <p>But failed to fetch data of an object.</p>
  <pre><code>{
    &quot;lambeosaurus&quot; : {
      &quot;height&quot; : 2.1,
      &quot;length&quot; : 12.5,
      &quot;weight&quot; : 5000
    },
    &quot;stegosaurus&quot; : {
      &quot;height&quot; : 4,
      &quot;length&quot; : 9,
      &quot;weight&quot; : 2500
    }
  }
  </code></pre>
  <p>(Data in an object)</p>
  <pre><code>Array []
  </code></pre>
  <p>(Result in the console)</p>
  <p>Can I know what I'm missing and how to fetch data of an object, not an array?
  Thank you for your help in advance.</p>