title: react-table check data presence before useTable hook
body: <p>I am new in react-table, actually I am trying to rewrite crappy react-bootstrap-table2 into react-table.</p>
  
  <p>I am fetching data with axios and then, in my react-table component I am retrieving then with useSelect.Then I use them in useTable hook, but</p>
  
  <pre><code>import React from "react";
  import {useSelector} from "react-redux";
  import {useTable} from "react-table";
  
  function Table() {
  
  let testsData = useSelector(state =&gt; 
  state.fetchTestsData.testsData);
  console.log("testData to show in table ", testsData);
  testsData = !(testsData === null || testsData.length === 0) ?  [];
  
  
  const columns = React.useMemo(
      () =&gt; [
          {
              Header: '1',
              accessor: '1column',
          },
          {
              Header: '2',
              accessor: '2column',
          },
      ],
      []
  );
  
  const {
      getTableProps,
      getTableBodyProps,
      headerGroups,
      rows,
      prepareRow,
  } = useTable({columns, testsData});
  
  
  const {
      getTableProps,
      getTableBodyProps,
      headerGroups,
      rows,
      prepareRow,
  } = useTable({columns, testsData});
  </code></pre>
  
  <p>there is a moment, when there are no data. I cannot put useTable in if condition cause it's hook. How can I check my data for existance? react-table gives me TypeError: Cannot read property 'forEach' of undefined</p>
  
  <p>p.s I updated the above snippet. It still gives me an error.</p>
  
  <p>Even if I declare testsData = []; and pass it to useTable- it gives an error</p>