title: ReactJS, axios response is not being sent to my dataSet properly
body: <p>i've been grinding my brain how to fix this. I have a DataTable component that displays a dataSet from axios response (from parent - ProductListing). </p>
  
  <p>I can get the expected result from axios but only after the DataTable is already rendered, I know im just missing something, hope someone can help me.</p>
  
  <p>ProductListing component</p>
  
  <pre><code>class ProductListings extends Component {
    constructor(props){
      super(props);
  
      this.state = {
        dataSet: []
      }
    }
    componentDidMount(){
      this.props.getProducts({}).then(
        (res) =&gt; {
          this.setState({ dataSet: res.data });
        }
      );
    }
    render(){
      console.log(this.state.dataSet);
      return (
        &lt;div className="content-wrapper"&gt;
          &lt;section className="content-header"&gt;
            &lt;DataTable dataSet={this.state.dataSet}/&gt;
          &lt;/section&gt;
        &lt;/div&gt;
      );
    }
  }
  export default connect(null, {getProducts})(ProductListings);
  </code></pre>
  
  <p>DataTable component</p>
  
  <pre><code>class DataTable extends Component {
    componentDidMount(){
      this.$el = $(this.el);
      this.$el.DataTable(
        {
          data: this.props.dataSet,
          columns: [
            { title: "ID" },
            { title: "Title" },
            { title: "Short Desc" },
            { title: "Full Desc" },
            { title: "Release Type" },
            { title: "Country Code" }
          ],
          buttons: [
            'copy'
          ]
        }
      )
    }
    componentWillUnmount(){
  
    }
    render(){
      return (
        &lt;div&gt;
          &lt;table className="display" width="100%" ref={el =&gt; this.el = el}&gt;&lt;/table&gt;
        &lt;/div&gt;
      );
    }
  }
  export default DataTable;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/BktPN.png" rel="nofollow noreferrer">Console log 1</a>
  <a href="https://i.stack.imgur.com/xVFtv.png" rel="nofollow noreferrer">Console log 2</a></p>