title: Cannot get value from state - React
body: <p>Hey this is my code and I want to print the networkType but it is not priniting out anything this code was working in App.js but not in home.js.</p>
  <p>I created a class component in home.js</p>
  <p><strong>Home.js</strong>:</p>
  <pre><code>import {Component, React} from 'react';
  import { BrowserRouter as Router, Link } from 'react-router-dom';
  import Web3 from 'web3';
  class Home extends Component
  {
      state={
          person : [
            {networkType:'None'}
          ]
      }
      
      componentDidMount()
      {
          this.loadBlockchainData();
      }
      
      async loadBlockchainData()
      {
          const web3 = new Web3(Web3.givenProvider || &quot;https://localhost:8545&quot;);
          const network = await web3.eth.net.getNetworkType();
          this.setState(
              {
                  person:[
                      {networkType:network}
                  ]
              }
          )
      }
      render()
      {
          return(
              &lt;div&gt;
                  &lt;h1&gt;Hello&lt;/h1&gt;
                  &lt;h1&gt;Network is: {this.state.networkType}&lt;/h1&gt;
              &lt;/div&gt;
          )
      }
  }
  export default Home; 
  </code></pre>