title: Datatables button through React App
body: <p>I've been having issues trying to add an excel export button when working in React. I assume it has something to do with an import but I can't find much help online related to React and DataTables.net in this regard. I just want a user to be able to download to excel.</p>
  
  <p>these are my imports related to jquery and datatables</p>
  
  <pre><code>const $ = require('jquery');
  $.DataTable = require('datatables.net');
  import 'datatables.net-dt/css/jquery.dataTables.css'
  </code></pre>
  
  <p>here is where the table is defined. It works except for the buttons</p>
  
  <pre><code>componentDidMount() {
      this.$el = $(this.el);
      this.$el.DataTable({
            dom: 'Bfrtip',
            data: this.makeArray(),
            columns: this.getColumns(),
            pageLength:this.props.json.length,
            buttons: [
                  {
                      extend: 'excel',
                      text: 'Save current page',
                      fileName:  "data.xlsx",
                      exportOptions: {
                         modifier: {
                              page: 'current'
                             }
                      }
                   }]});
  }
  </code></pre>
  
  <p>this is the render method</p>
  
  <pre><code>render() {
      return (
          &lt;div&gt;
              &lt;table className="display" width="100%" ref={el=&gt;this.el=el} /&gt;
          &lt;/div&gt;);
  }
  </code></pre>
  
  <p>any help is appreciated </p>