title: React useTable hook with typescript
body: <p>So I have a JavaScript class with useTable.
  In Java script its been used like below</p>
  <pre><code>import {useTable, useFilters,useAsyncDebounce,useSortBy,usePagination,} from &quot;react-table&quot;;
  
  const {getTableProps,getTableBodyProps, headerGroups, page,prepareRow,state,visibleColumns, nextPage,pageOptions,pageCount,previousPage,canPreviousPage,canNextPage,setPageSize,gotoPage
        } = useTable({columns,data,defaultColumn,filterTypes,initialState: { pageSize: 10, pageIndex: 0 }
         },useFilters, useSortBy,usePagination);
  </code></pre>
  <p>I'm converting my javascript project to typescript.</p>
  <p>In typescript that <code>useTable</code> line gives errors.</p>
  <p>Example : <code>Property 'page' does not exist on type 'TableInstance&lt;object&gt;'.ts(2339)</code></p>
  <p><a href="https://i.stack.imgur.com/taGkw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/taGkw.png" alt="enter image description here" /></a></p>
  <p>That <code>initialState</code> attribute gives my below error</p>
  <pre><code>Type '{ pageSize: number; pageIndex: number; }' is not assignable to type 'Partial&lt;TableState&lt;object&gt;&gt;'.
    Object literal may only specify known properties, and 'pageSize' does not exist in type 'Partial&lt;TableState&lt;object&gt;&gt;'.ts(2322)
  index.d.ts(172, 5): The expected type comes from property 'initialState' which is declared here on type 'TableOptions&lt;object&gt;'
  </code></pre>
  <p>How to write that <code>useTable</code> line in Typescript ?</p>