title: How to render data from state in React table?
body: <p>I'm currently using React Table to build a table to input my data. Data is being pushed through from the server and is being updated on the state. 
  The state "Names" is an array of hashes with 2 keys, number and name.</p>
  
  <p>However, the table is not updating with any data. </p>
  
  <p>Any help would be much appreciated.</p>
  
  <pre><code>class Table extends Component {
    state = {
      names: []
    };
  
    connectSocket = () =&gt; {
      const socketURL = 'http://localhost:3001/';
      const socket = io(socketURL);
      socket.on('connect', () =&gt; {
        console.log('connected socket server');
      });
      socket.io.on('connect_error', () =&gt; {
        console.log('Error connecting to server');
      });
      socket.on('updates', (data) =&gt; {
        this.setState(
          {
            names: data
          },
          () =&gt; {
            // console.log(this.state.names);
          }
        );
      });
    };
  
    componentDidMount() {
      this.connectSocket();
    }
  
    render() {
      const columns = [
        {
          Header: 'ID',
          accesor: 'number',
          sortable: false
        },
        {
          Header: 'Number',
          accesor: 'number',
          sortable: true
        },
        {
          Header: 'Name',
          accesor: 'name',
          sortable: false
        }
      ];
      return (
        &lt;div&gt;
          &lt;ReactTable
            columns={columns}
            data={this.state.names}
            noDataText={'Loading...'}
          /&gt;
        &lt;/div&gt;
      );
    }
  }
  </code></pre>